Skip to content

Commit

Permalink
dispatcher: documentation for dispatcher.hash rpc command
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed May 20, 2020
1 parent aac6c77 commit be1e23d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/modules/dispatcher/doc/dispatcher_admin.xml
Expand Up @@ -1960,6 +1960,46 @@ DEST: {
&sercmd; dispatcher.remove 2 sip:127.0.0.1:5080
&sercmd; dispatcher.remove 3 sip:127.0.0.1:5075;transport=udp
...
</programlisting>
</section>
<section id="dispatcher.r.hash">
<title>
<function moreinfo="none">dispatcher.hash</function>
</title>
<para>
Compute the hash id corresponding to the string parameter values.
</para>
<para>
Return the hash id and the corresponding slot, if 'nslots' parameter
is not 0.
</para>
<para>
Name: <emphasis>dispatcher.hash</emphasis>
</para>
<para>Parameters:</para>
<itemizedlist>
<listitem><para>_nslots_: number of slots</para></listitem>
<listitem><para>_val1_: string value</para></listitem>
<listitem><para>_val2_: (optional) string value</para></listitem>
</itemizedlist>
<para>
It can be useful to find what address in a destination group (setid) is
going to be used when hashing a value or a URI. For a URI, the
corresponding username and domain have to be provided as _val1_ and
_val2_. If the URI has a port different than 5060 (or 5061 for TLS),
then the _val2_ has to be 'domain:port'. The _nslots_ has to be the
number of addresses in the group (setid). The returned 'slot' value
represents the index of the address to be used for routing.
</para>
<para>
Example:
</para>
<programlisting format="linespecific">
...
# prototype: &kamctl; rpc dispatcher.hash _nslots_ _val1_ [_val2_]
&kamctl; rpc dispatcher.hash 0 alice server.com
&kamctl; rpc dispatcher.hash 4 bob server.com
...
</programlisting>
</section>

Expand Down

0 comments on commit be1e23d

Please sign in to comment.