Module: sip-router
Branch: pd/outbound
Commit: a117147b4c6563be21c0403eeeacf5ff0f3ba709
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a117147…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Tue Jan 1 20:46:18 2013 +0000
modules_k/outbound: updated example
---
modules_k/outbound/README | 48 ++++++++++++++++++----------
modules_k/outbound/doc/outbound_admin.xml | 36 +++++++++++++++------
2 files changed, 56 insertions(+), 28 deletions(-)
diff --git a/modules_k/outbound/README b/modules_k/outbound/README
index 438ebb3..8a98e0c 100644
--- a/modules_k/outbound/README
+++ b/modules_k/outbound/README
@@ -23,7 +23,7 @@ Peter Dunkley
3. Parameters
- 3.1. force_outbound_bflag (integer)
+ 3.1. force_outbound_flag (integer)
3.2. flow_token_key (string)
4. Functions
@@ -34,7 +34,7 @@ Peter Dunkley
1.1. Compiling Kamailio with STUN support
1.2. Edge Proxy Configuration
1.3. Registrar Configuration
- 1.4. Set force_outbound_bflag parameter
+ 1.4. Set force_outbound_flag parameter
1.5. Set flow_token_key parameter
Chapter 1. Admin Guide
@@ -53,7 +53,7 @@ Chapter 1. Admin Guide
3. Parameters
- 3.1. force_outbound_bflag (integer)
+ 3.1. force_outbound_flag (integer)
3.2. flow_token_key (string)
4. Functions
@@ -116,19 +116,33 @@ modparam("websocket", "keepalive_timeout",
FLOW_TIMER+5)
...
modparam("outbound", "flow_token_key", "!!!Kamailio
rocks!!!")
...
-###TBD###
-
- Example 1.3. Registrar Configuration
+route {
...
-#!define FLOW_TIMER 20
+ if (is_method("INVITE|SUBSCRIBE"))
+ record_route();
+ else if (is_method("REGISTER"))
+ add_path();
...
-tcp_connection_lifetime=FLOW_TIMER+10
+}
+...
+onreply_route {
+ if (!t_check_trans()) {
+ drop;
+ }
+
+ if ($rm == "REGISTER" && $rs >= 200 && $rs <=
299)
+ {
+ if ($(hdr(Require)[*])=~"outbound")
+ insert_hf("Flow-Timer: FLOW_TIMER\r\n",
"Call-ID");
+ }
+}
+
+ Example 1.3. Registrar Configuration
...
loadmodule "registrar.so"
...
-modparam("registrar", "flow_timer", FLOW_TIMER)
+modparam("registrar", "outbound_mode", 2)
...
-###TBD###
2. Dependencies
@@ -148,19 +162,19 @@ modparam("registrar", "flow_timer", FLOW_TIMER)
3. Parameters
- 3.1. force_outbound_bflag (integer)
+ 3.1. force_outbound_flag (integer)
3.2. flow_token_key (string)
-3.1. force_outbound_bflag (integer)
+3.1. force_outbound_flag (integer)
- A branch flag which, if set for a request, will force path and rr to
- add flow tokens to Path: and Record-Route: headers regardless of the
- request contents.
+ A flag which, if set for a request, will force path and rr to add flow
+ tokens to Path: and Record-Route: headers regardless of the request
+ contents.
Default value is -1.
- Example 1.4. Set force_outbound_bflag parameter
-modparam("outbound", "force_outbound_bflag", 1)
+ Example 1.4. Set force_outbound_flag parameter
+modparam("outbound", "force_outbound_flag", 1)
3.2. flow_token_key (string)
diff --git a/modules_k/outbound/doc/outbound_admin.xml
b/modules_k/outbound/doc/outbound_admin.xml
index de3e3d3..992c0c4 100644
--- a/modules_k/outbound/doc/outbound_admin.xml
+++ b/modules_k/outbound/doc/outbound_admin.xml
@@ -71,22 +71,36 @@ modparam("websocket", "keepalive_timeout",
FLOW_TIMER+5)
...
modparam("outbound", "flow_token_key", "!!!Kamailio
rocks!!!")
...
-###TBD###
+route {
+...
+ if (is_method("INVITE|SUBSCRIBE"))
+ record_route();
+ else if (is_method("REGISTER"))
+ add_path();
+...
+}
+...
+onreply_route {
+ if (!t_check_trans()) {
+ drop;
+ }
+
+ if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299)
+ {
+ if ($(hdr(Require)[*])=~"outbound")
+ insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
+ }
+}
]]></programlisting>
</example>
<example>
<title>Registrar Configuration</title>
<programlisting><![CDATA[
...
-#!define FLOW_TIMER 20
-...
-tcp_connection_lifetime=FLOW_TIMER+10
-...
loadmodule "registrar.so"
...
-modparam("registrar", "flow_timer", FLOW_TIMER)
+modparam("registrar", "outbound_mode", 2)
...
-###TBD###
]]></programlisting>
</example>
</section>
@@ -123,17 +137,17 @@ modparam("registrar", "flow_timer", FLOW_TIMER)
<section>
<title>Parameters</title>
<section>
- <title><varname>force_outbound_bflag</varname>
(integer)</title>
- <para>A branch flag which, if set for a request, will force
+ <title><varname>force_outbound_flag</varname>
(integer)</title>
+ <para>A flag which, if set for a request, will force
<emphasis>path</emphasis> and <emphasis>rr</emphasis> to add
flow tokens to Path: and Record-Route: headers regardless of
the request contents.</para>
<para><emphasis>Default value is -1.</emphasis></para>
<example>
- <title>Set <varname>force_outbound_bflag</varname> parameter
+ <title>Set <varname>force_outbound_flag</varname> parameter
</title>
<programlisting format="linespecific">
-modparam("outbound", "force_outbound_bflag", 1)
+modparam("outbound", "force_outbound_flag", 1)
</programlisting>
</example>
</section>