<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Nguyen,<br>
<br>
I see you are not handling the case when the load_balance() returns
false (like no destination available or all full).<br>
<br>
Also, for sequential requests ( in has_totag() branch ) is bogus to
do t_relay() and forward in the same time. You should do only
t_relay() and allow the request to go based on loose_route() info.<br>
<br>
Regards,<br>
Bogdan<br>
<br>
On 08/01/2011 01:48 PM, nguyen khue wrote:
<blockquote
cite="mid:1312195713.61430.YahooMailNeo@web110013.mail.gq1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div id="yiv251490087">
<div style="color: rgb(0, 0, 0); background-color: rgb(255,
255, 255); font-size: 12pt; font-family: 'times new
roman','new york',times,serif;">
<div id="yiv251490087yui_3_2_0_4_131219107428748"
style="font-size: 12pt; font-family: times,serif;"><span
id="yiv251490087yui_3_2_0_4_131219107428788">Hi Vlad,</span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"
style="font-size: 12pt; font-family: times,serif;"><span
id="yiv251490087yui_3_2_0_4_131219107428788"><br>
</span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"
style="font-size: 12pt; font-family: times,serif;"><span
id="yiv251490087yui_3_2_0_4_131219107428788">I use two
Asterisks to test with OpenSIPS. I have 1000 users from
1000 to 2000, with user had last number is 0,1,2,3,4
(ex: 1000, 1001, ...) I route it to Asterisk 1 (id = 1),
other users, I route it to Asterisk 2 (id = 2).</span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"
style="font-size: 12pt; font-family: times,serif;"><span
id="yiv251490087yui_3_2_0_4_131219107428788">This is
content of load_balancer table in database:</span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
id="yiv251490087yui_3_2_0_4_131219107428788">
<div id="yiv251490087yui_3_2_0_4_131219107428748">+----+----------+-------------------+-------------------+------------+-------------+</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">| id |
group_id | dst_uri | resources |
probe_mode | description |</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">+----+----------+-------------------+-------------------+------------+-------------+</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">| 1 |
1 | <a class="moz-txt-link-freetext" href="sip:192.168.0.178">sip:192.168.0.178</a> | transc=30;pstn=30 |
0 | |</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">| 2 |
2 | <a class="moz-txt-link-freetext" href="sip:192.168.0.176">sip:192.168.0.176</a> | transc=30;pstn=30 |
0 | |</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">+----+----------+-------------------+-------------------+------------+-------------+</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">I had
develop one module for my project with name
call_monitor, in this module, I process some SIP
messages as: INVITE, 200 OK, INFO, BYE.</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">This
is config file, please check it for me</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">
<div id="yiv251490087yui_3_2_0_4_131219107428748">route{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!mf_process_maxfwd_header("10")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("483","Too
Many Hops");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("INFO")){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!process_info_message()){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("503","Service
Unavaiable");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.178:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.176:5060");<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">
}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(has_totag()) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># sequential
request withing a dialog should</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># take the path
determined by record-routing</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(loose_route()) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("BYE")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>setflag(1); #
do accounting ...</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>setflag(3); #
... even if the transaction fails</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>process_bye_message();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.178:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.176:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> <br>
</span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>} else if
(is_method("INVITE")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># even if in
most of the cases is useless, do RR for</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># re-INVITEs
alos, as some buggy clients do change route set</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># during the
dialog.</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>record_route();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># route it out
to whatever destination was set by loose_route()</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># in $du
(destination URI).</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("ACK"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(t_check_trans()){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.178:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.176:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>route(1);</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>} else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if (
is_method("ACK") ) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if (
t_check_trans() ) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># non
loose-route, but stateful ACK; must be an ACK after </div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># a 487 or e.g.
404 from upstream server</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.178:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.176:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>} else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># ACK without
matching transaction -></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># ignore and
discard</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("BYE")){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>process_bye_message();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.178:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {<span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>forward("192.168.0.176:5060");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>#sl_send_reply("404","Not
here");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># CANCEL
processing</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("CANCEL"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(t_check_trans())</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_check_trans();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># preloaded
route checking</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(loose_route()) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>xlog("L_ERR",</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>"Attempt to
route with preloaded Route's [$fu/$tu/$ru/$ci]");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!is_method("ACK"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> <br>
</span>sl_send_reply("403","Preload Route denied");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># record
routing</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!is_method("REGISTER|MESSAGE"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>record_route();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># account only
INVITEs</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("INVITE")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>setflag(1); #
do accounting</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!uri==myself)</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>append_hf("P-hint:
outbound\r\n"); </div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>route(1);</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("PUBLISH"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("503",
"Service Unavailable");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("REGISTER"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287318"> </span>if
(!save("location"))</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287325"> </span>sl_reply_error();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($rU==NULL)
{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># request with
no Username in RURI</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("484","Address
Incomplete");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"><br>
</span># do lookup with method filtering</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!lookup("location","m")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>switch
($retcode) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>case -1:</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>case -3:</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>#t_newtran();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>#t_reply("404",
"Not Found");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>route(2);</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>case -2:</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("405",
"Method Not Allowed");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span># when routing
via usrloc, log the missed calls also</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"><br>
</span>setflag(2);</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>route(1);</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">route[2]{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(is_method("INVITE")){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(!has_totag()){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(vega_process_invite()){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_on_branch("2");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> <br>
</span>t_on_failure("1");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_on_reply("2");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span></div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if ($fU
=~"1[0-9][0-9][0-5]"){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>load_balance("1","pstn");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>load_balance("2","pstn");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>t_relay();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>else {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>xlog("Process
INVITE failed, drop call anyway\n");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>sl_send_reply("404","Method
not Allowed");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> <br>
</span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">branch_route[2]
{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>xlog("new
branch at $ru\n");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">onreply_route[2]
{<br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287274"> </span>xlog("incoming
reply\n");</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287267"> </span>if
(has_body("application/sdp")){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287260"> </span>if
(process_ok_message()){</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287253"> </span>exit();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287246"> </span>}else
{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287239"> </span>drop();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287232"> </span>exit();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287225"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287218"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287209"> </span>if
(t_check_status("404")) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287202"> </span>process_nothere_message();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287195"> </span>exit();</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"
id="yiv251490087yui_3_2_0_4_1312191074287188"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">failure_route[1]
{</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>if
(t_was_cancelled()) {</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>exit;</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748"><span
class="yiv251490087Apple-tab-span"
style="white-space: pre;"> </span>}</div>
<div id="yiv251490087yui_3_2_0_4_131219107428748">}</div>
<div id="yiv251490087yui_3_2_0_4_1312191074287369"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_1312191074287369">I
had removed route[1], because all case will jump to
route[2].</div>
<div id="yiv251490087yui_3_2_0_4_1312191074287369"><br>
</div>
<div id="yiv251490087yui_3_2_0_4_1312191074287369">Thanks
& Best regards</div>
<div id="yiv251490087yui_3_2_0_4_1312191074287369">Khue
Nguyen.</div>
</div>
</span></div>
<div style="font-size: 12pt; font-family: times,serif;"><br
id="yiv251490087yui_3_2_0_4_131219107428751">
</div>
<div style="font-size: 12pt; font-family: times,serif;"
id="yiv251490087yui_3_2_0_4_131219107428754"
class="yiv251490087yui_3_2_0_4_131219107428752">
<div style="font-size: 12pt; font-family: 'times new
roman','new york',times,serif;"
class="yiv251490087yui_3_2_0_4_131219107428757"><font
face="Arial" size="2">
<hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Vlad Paiu <a class="moz-txt-link-rfc2396E" href="mailto:vladpaiu@opensips.org"><vladpaiu@opensips.org></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b>
Monday, August 1, 2011 3:17 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
Re: [OpenSIPS-Users] problem with module dialog<br>
</font><br>
<div id="yiv251490087"> Hello,<br>
<br>
It seems that you somehow loop the traffic to your
server, because that error means the message has over
64 Route headers. <br>
Please check your config file for the source of this
bad routing.<br>
<br>
<br>
Regards,<br>
<pre class="yiv251490087moz-signature">--
Vlad Paiu
OpenSIPS Developer</pre>
<br>
<br>
On 07/30/2011 06:28 AM, nguyen khue wrote:
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255); font-size: 12pt; font-family:
'times new roman','new york',times,serif;"
class="yiv251490087yui_3_2_0_4_131219107428761">
<div><span>Hi all,</span></div>
<div><span><br>
</span></div>
<div><span>I am using module dialog with module
load_balancer. I use sipp to test performance,
with 50 first calls, opensips work normal.
But, from the call 51th opensips had error:</span></div>
<div><span><span
class="yiv251490087Apple-style-span
yiv251490087yui_3_2_0_4_131219107428783"
style="font-size: 16px; font-family: 'Times
New Roman';">
<pre><i>ERROR:core:print_rr_body: too many RR</i></pre>
<pre><span>I use opensips 1.6.2, please help me fix it.</span></pre>
<pre><span>Best regards</span></pre>
<pre><span>Khue Nguyen.</span></pre>
</span></span></div>
<div><br>
</div>
</div>
<pre><fieldset class="yiv251490087mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" rel="nofollow" class="yiv251490087moz-txt-link-abbreviated" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" rel="nofollow" class="yiv251490087moz-txt-link-freetext" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true" rel="nofollow"
ymailto="mailto:Users@lists.opensips.org"
target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a moz-do-not-send="true" rel="nofollow" target="_blank"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 19th of September 2011
OpenSIPS solutions and "know-how"</pre>
</body>
</html>