Browse code

dispatcher: documentation for dispatcher.hash rpc command

Daniel-Constantin Mierla authored on 20/05/2020 19:48:29
Showing 1 changed files
... ...
@@ -1962,6 +1962,46 @@ DEST: {
1962 1962
 ...
1963 1963
 </programlisting>
1964 1964
     </section>
1965
+		<section id="dispatcher.r.hash">
1966
+		<title>
1967
+		<function moreinfo="none">dispatcher.hash</function>
1968
+		</title>
1969
+		<para>
1970
+		Compute the hash id corresponding to the string parameter values.
1971
+		</para>
1972
+		<para>
1973
+		Return the hash id and the corresponding slot, if 'nslots' parameter
1974
+		is not 0.
1975
+		</para>
1976
+		<para>
1977
+		Name: <emphasis>dispatcher.hash</emphasis>
1978
+		</para>
1979
+		<para>Parameters:</para>
1980
+		<itemizedlist>
1981
+			<listitem><para>_nslots_: number of slots</para></listitem>
1982
+			<listitem><para>_val1_: string value</para></listitem>
1983
+			<listitem><para>_val2_: (optional) string value</para></listitem>
1984
+		</itemizedlist>
1985
+		<para>
1986
+		It can be useful to find what address in a destination group (setid) is
1987
+		going to be used when hashing a value or a URI. For a URI, the
1988
+		corresponding username and domain have to be provided as _val1_ and
1989
+		_val2_. If the URI has a port different than 5060 (or 5061 for TLS),
1990
+		then the _val2_ has to be 'domain:port'. The _nslots_ has to be the
1991
+		number of addresses in the group (setid). The returned 'slot' value
1992
+		represents the index of the address to be used for routing.
1993
+		</para>
1994
+		<para>
1995
+		Example:
1996
+		</para>
1997
+<programlisting  format="linespecific">
1998
+...
1999
+# prototype: &kamctl; rpc dispatcher.hash _nslots_ _val1_ [_val2_]
2000
+&kamctl; rpc dispatcher.hash 0 alice server.com
2001
+&kamctl; rpc dispatcher.hash 4 bob server.com
2002
+...
2003
+</programlisting>
2004
+    </section>
1965 2005
 
1966 2006
    </section>
1967 2007