Browse code

rr: docs for loose_route_mode() function

Daniel-Constantin Mierla authored on 14/09/2020 11:34:38
Showing 1 changed files
... ...
@@ -442,6 +442,34 @@ if(!loose_route_preloaded()) {
442 442
       </example>
443 443
     </section>
444 444
 
445
+	<section id="rr.f.loose_route_mode">
446
+      <title><function moreinfo="none">loose_route_mode(vmode)</function></title>
447
+
448
+	  <para>The function is similar to `loose_route()`, but it does only
449
+	  loose routing processing if vmode==1, skipping the testing of r-uri==myself
450
+	  for performing strict routing. If vmode==0, it behaves like loose_route().
451
+      </para>
452
+      <para>It is a convenient function to use with application servers that
453
+      set the Contact URI to SIP server address.
454
+      </para>
455
+      <para>This function can be used from REQUEST_ROUTE.</para>
456
+
457
+      <example>
458
+        <title><function>loose_route_mode</function> usage</title>
459
+
460
+        <programlisting format="linespecific">
461
+...
462
+if(has_totag() and uri==myself) {
463
+    if(loose_route_mode("1")) {
464
+        rewritehostport("my.app.server:5090");
465
+        t_relay();
466
+        exit;
467
+    }
468
+}
469
+...
470
+</programlisting>
471
+      </example>
472
+    </section>
445 473
 
446 474
     <section id="rr.f.record_route">
447 475
       <title><function moreinfo="none">record_route([sparams])</function></title>