Browse code

dispatcher: docs for ds_is_active()

Daniel-Constantin Mierla authored on 13/09/2021 08:20:34
Showing 1 changed files
... ...
@@ -1732,6 +1732,46 @@ if(ds_is_from_list("10", "3", "sip:127.0.0.1:5080")) {
1732 1732
     ...
1733 1733
 }
1734 1734
 ...
1735
+</programlisting>
1736
+		</example>
1737
+	</section>
1738
+	<section  id="dispatcher.f.ds_is_active">
1739
+		<title>
1740
+		<function moreinfo="none">ds_is_active(groupid [, uri])</function>
1741
+		</title>
1742
+		<para>
1743
+		This function returns true, if there is an active URI in the destination
1744
+		group; otherwise false. If the uri parameter is provided, then the
1745
+		corresponding destination has to be active.
1746
+		</para>
1747
+		<para>Description of parameters:</para>
1748
+		<itemizedlist>
1749
+		<listitem>
1750
+			<para><emphasis>groupid</emphasis> - the group id. The parameter
1751
+				can be an integer or a variable holding an integer value.
1752
+			</para>
1753
+		</listitem>
1754
+        <listitem>
1755
+			<para><emphasis>uri</emphasis> (optional) - the URI of the destination.
1756
+			if parameter is empty or missing, the any destination is matched.
1757
+            </para>
1758
+        </listitem>
1759
+		</itemizedlist>
1760
+
1761
+		<para>
1762
+			This function can be used from ANY_ROUTE.
1763
+		</para>
1764
+		<example>
1765
+		<title><function>ds_is_active</function> usage</title>
1766
+		<programlisting format="linespecific">
1767
+...
1768
+if(ds_is_active("10")) {
1769
+    ...
1770
+}
1771
+if(ds_is_active("10", "sip:127.0.0.1:5080")) {
1772
+    ...
1773
+}
1774
+...
1735 1775
 </programlisting>
1736 1776
 		</example>
1737 1777
 	</section>