<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
Hello all,</p>
<p></p>
<p>I have a trouble that is related to the way of usage of
dispatcher module.</p>
<p>I am working with Kamailio 5.3.2 and using dispatcher module as
load balancer to route calls to the media gateways. <br>
</p>
<p>My dispatching routes are below as simply,<br>
</p>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #d4d4d4;">route[DISPATCH] {</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(ds_select_domain(</span><span style="color: #ce9178;">"2"</span><span style="color: #d4d4d4;">, </span><span style="color: #ce9178;">"4"</span><span style="color: #d4d4d4;">)) {</span></div><div><span style="color: #d4d4d4;"> route(MYRELAY);</span></div><div><span style="color: #d4d4d4;"> } </span><span style="color: #569cd6;">else</span><span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;"> send_reply(</span><span style="color: #ce9178;">"503"</span><span style="color: #d4d4d4;">,</span><span style="color: #ce9178;">"Service Unavailable - No MGW"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;">}</span></div>
<div><span style="color: #d4d4d4;">route[MYRELAY] {</span></div><div><span style="color: #d4d4d4;"> t_on_failure(</span><span style="color: #ce9178;">"MYFAILURE"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(!t_relay()) {</span></div><div><span style="color: #d4d4d4;"> sl_reply_error();</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;">}</span></div>
<div><span style="color: #d4d4d4;">failure_route[MYFAILURE] {</span></div><div><span style="color: #d4d4d4;"> route(NATMANAGE);</span></div><div><span style="color: #d4d4d4;"> revert_uri();</span></div>
<div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;"> (t_is_canceled()) {</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div>
<div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;"> ($T_reply_code == </span><span style="color: #b5cea8;">408</span><span style="color: #d4d4d4;"> || $T_reply_code == </span><span style="color: #b5cea8;">503</span><span style="color: #d4d4d4;">) {</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(ds_next_domain()) {</span></div><div><span style="color: #d4d4d4;"> route(MYRELAY);</span></div><div><span style="color: #d4d4d4;"> } </span><span style="color: #569cd6;">else</span><span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;"> send_reply(</span><span style="color: #ce9178;">"503"</span><span style="color: #d4d4d4;">,</span><span style="color: #ce9178;">"Service Unavailable"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;"> } </span><span style="color: #569cd6;">else</span><span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(ds_select_domain(</span><span style="color: #ce9178;">"6"</span><span style="color: #d4d4d4;">, </span><span style="color: #ce9178;">"4"</span><span style="color: #d4d4d4;">)) {</span></div><div><span style="color: #d4d4d4;"> route(MYVMRELAY);</span></div><div><span style="color: #d4d4d4;"> } </span><span style="color: #569cd6;">else</span><span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;"> send_reply(</span><span style="color: #b5cea8;">486</span><span style="color: #d4d4d4;">,</span><span style="color: #ce9178;">"Busy"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;">}</span></div>
<div><span style="color: #d4d4d4;">route[MYVMRELAY] {</span></div><div><span style="color: #d4d4d4;"> t_on_failure(</span><span style="color: #ce9178;">"MYVMFAILURE"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(!t_relay()) {</span></div><div><span style="color: #d4d4d4;"> sl_reply_error();</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;">}</span></div>
<div><span style="color: #d4d4d4;">failure_route[MYVMFAILURE] {</span></div><div><span style="color: #d4d4d4;"> route(NATMANAGE);</span></div><div><span style="color: #d4d4d4;"> revert_uri();</span></div>
<div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;"> (t_is_canceled()) {</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div>
<div><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">if</span><span style="color: #d4d4d4;">(ds_next_domain()) {</span></div><div><span style="color: #d4d4d4;"> route(MYVMRELAY);</span></div><div><span style="color: #d4d4d4;"> } </span><span style="color: #569cd6;">else</span><span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;"> send_reply(</span><span style="color: #ce9178;">"503"</span><span style="color: #d4d4d4;">,</span><span style="color: #ce9178;">"Service Unavailable"</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> exit;</span></div><div><span style="color: #d4d4d4;"> }</span></div><div><span style="color: #d4d4d4;">}
</span></div></div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">I have multiple media gateways(setid=2)
and voicemail servers(setid=6). As can be seen from the
configuration,</div>
<div class="moz-signature"> after first routing, for transaction
reply code except 408 or 503, I am routing call to the voicemail
server using dispatcher.</div>
<div class="moz-signature">In that phase, dispatcher module is
remembering previously loaded destinations that come from first
ds_select_domain</div>
<div class="moz-signature">and module try to route these
destinations in the case that all voicemail servers are
unavailable. <br>
</div>
<div class="moz-signature">So basically, I want to unload all
destinations comes from previous ds_select_domain.</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">From the documentation, i tried
ds_load_update and ds_load_unset methods but not worked for me.</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Is there any way to overcome that problem
or any right usages of these methods. <br>
</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Thank you,</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Serdar<br>
</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature"><br>
</div>
</body>
</html>