<div><br></div><div>HI Robert,</div><div><br></div><div>Here I forwarding the OPensips LB table content,it may help-</div><div><br></div><div><div>mysql&gt; select * from load_balancer;</div><div>+----+----------+---------------------------+-----------+------------+-------------+</div>
<div>| id | group_id | dst_uri                             | resources | probe_mode | description |</div><div>+----+------------+---------------------------------------+-----------+-----------------------+-----------------+</div>
<div>|  1 |        2    | sip:OpenSIPs@x.x.x.1<span class="Apple-tab-span" style="white-space:pre">        </span>     | sip=5     |          2           | SW#1        |</div><div>|  2 |        2    | sip:OpenSIPs@x.x.x.2      | sip=4     |          2           | SW#2        |</div>
<div>+----+----------+---------------------------+-----------+------------+-------------+</div><div>2 rows in set (0.00 sec)</div></div><div><br></div><div><br></div><div>Regards</div><div>Tushar</div><div><br></div><div>
<br></div><br><br><div class="gmail_quote">On Mon, Jun 13, 2011 at 7:40 AM, Tushar Jain <span dir="ltr">&lt;<a href="mailto:tusshar.jain@gmail.com">tusshar.jain@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Robert,<div><br></div><div>Thanks for looking into my problem, here I am pasting my opensips.cfg file-</div><div><br></div><div>____________________________________________________________________</div><div><br></div><div>

<br></div><div><div><br></div><div>####### Global Parameters #########</div><div><br></div><div>debug=6</div><div>log_stderror=no</div><div>log_facility=LOG_LOCAL0</div><div><br></div><div>fork=yes</div><div>children=4</div>

<div><br></div><div>port=5060</div><div><br></div><div>listen=udp:x.x.x.x:5060</div><div><br></div><div>####### Modules Section ########</div><div><br></div><div>mpath=&quot;//lib/opensips/modules/&quot;</div><div><br></div>

<div>loadmodule &quot;db_mysql.so&quot;</div><div>loadmodule &quot;signaling.so&quot;</div><div>loadmodule &quot;sl.so&quot;</div><div>loadmodule &quot;tm.so&quot;</div><div>loadmodule &quot;rr.so&quot;</div><div>loadmodule &quot;maxfwd.so&quot;</div>

<div>loadmodule &quot;usrloc.so&quot;</div><div>loadmodule &quot;registrar.so&quot;</div><div>loadmodule &quot;textops.so&quot;</div><div>loadmodule &quot;mi_fifo.so&quot;</div><div>loadmodule &quot;uri.so&quot;</div><div>

loadmodule &quot;xlog.so&quot;</div><div>loadmodule &quot;acc.so&quot;</div><div>loadmodule &quot;siptrace.so&quot;</div><div>loadmodule &quot;auth.so&quot;</div><div>loadmodule &quot;auth_db.so&quot;</div><div>loadmodule &quot;alias_db.so&quot;</div>

<div>loadmodule &quot;domain.so&quot;</div><div>loadmodule &quot;permissions.so&quot;</div><div>loadmodule &quot;group.so&quot;</div><div>loadmodule &quot;drouting.so&quot;</div><div>loadmodule &quot;avpops.so&quot;</div>

<div>loadmodule &quot;dialplan.so&quot;</div><div>loadmodule &quot;aaa_radius.so&quot;</div><div>loadmodule &quot;dialog.so&quot;</div><div>loadmodule &quot;load_balancer.so&quot;</div><div><br></div><div>#------ avpops params -----</div>

<div>modparam(&quot;avpops&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;avpops&quot;, &quot;avp_table&quot;, &quot;usr_preferences&quot;)</div><div><br></div>

<div>#------ load the dpid field to a pseudo-variable $avp(s:dpid) ------</div><div>modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;$avp(s:rpid)=rpid ;$avp(s:countrycode)=contrycode;$avp(s:areacode)=areacode&quot;)</div>

<div>modparam(&quot;dialplan&quot;, &quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div><br></div><div>## attribute of the matched line will be store in the $avp(s:dest)</div><div>modparam(&quot;dialplan&quot;, &quot;attrs_pvar&quot;, &quot;$avp(s:dest)&quot;)</div>

<div><br></div><div><br></div><div><br></div><div># ----- drouting params -----</div><div>#modparam(&quot;drouting&quot;, &quot;sort_order&quot;, 0)</div><div>modparam(&quot;drouting&quot;, &quot;use_domain&quot;, 1)</div>

<div>modparam(&quot;drouting&quot;,&quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;drouting&quot;, &quot;probing_interval&quot;, 60)</div><div>modparam(&quot;drouting&quot;, &quot;probing_from&quot;, &quot;sip:pinger@x.x.x.x&quot;)</div>

<div>modparam(&quot;drouting&quot;, &quot;probing_method&quot;, &quot;OPTIONS&quot;)</div><div>modparam(&quot;drouting&quot;, &quot;probing_reply_codes&quot;, &quot;501, 403, 404&quot;)</div><div><br></div><div># ----- Group ----</div>

<div>#modparam(&quot;permissions&quot;, &quot;db_mode&quot;, 1)</div><div>modparam(&quot;group&quot;,&quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div><br></div><div># ----- Permissions ----</div>

<div>#modparam(&quot;permissions&quot;, &quot;db_mode&quot;, 1)</div><div>modparam(&quot;permissions&quot;,&quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div><br></div><div># ----- mi_fifo params -----</div>

<div>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/opensips_fifo&quot;)</div><div>modparam(&quot;mi_fifo&quot;, &quot;fifo_mode&quot;, 0666)</div><div><br></div><div><br></div><div>modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 13)</div>

<div>modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 1)</div><div>modparam(&quot;dialog&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;dialog&quot;, &quot;timeout_avp&quot;, &quot;$avp(i:30)&quot;)</div>

<div>modparam(&quot;dialog&quot;, &quot;default_timeout&quot;, 3600)</div><div><br></div><div># ----- rr params -----</div><div># add value to ;lr param to cope with most of the UAs</div><div>modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)</div>

<div># do not append from tag to the RR (no need for this script)</div><div>modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)</div><div><br></div><div><br></div><div># ----- Load Balancer -----</div><div>modparam(&quot;load_balancer&quot;, &quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div>

<div>modparam(&quot;load_balancer&quot;, &quot;probing_interval&quot;, 60)</div><div>modparam(&quot;load_balancer&quot;, &quot;probing_method&quot;, &quot;INFO&quot;)</div><div>modparam(&quot;load_balancer&quot;, &quot;probing_from&quot;, &quot;sip:1000@x.x.x.x&quot;)</div>

<div>modparam(&quot;load_balancer&quot;, &quot;db_table&quot;, &quot;load_balancer&quot;)</div><div>modparam(&quot;load_balancer&quot;, &quot;probing_reply_codes&quot;, &quot;501, 403, 404&quot;)</div><div><br></div><div>

# ----- registrar params -----</div><div>/* uncomment the next line not to allow more than 10 contacts per AOR */</div><div>#modparam(&quot;registrar&quot;, &quot;max_contacts&quot;, 10)</div><div><br></div><div><br></div>

<div># ----- usrloc params -----</div><div><br></div><div>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   0)</div><div><br></div><div>/* uncomment the following lines if you want to enable DB persistency</div><div>   for location entries */</div>

<div>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   2)</div><div>modparam(&quot;usrloc&quot;, &quot;db_url&quot;,<span style="white-space:pre-wrap">        </span>&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div>

<div><br></div><div><br></div><div># ----- uri params -----</div><div>modparam(&quot;uri&quot;, &quot;use_uri_table&quot;, 0)</div><div><br></div><div><br></div><div># ----- acc params -----</div><div>/* what sepcial events should be accounted ? */</div>

<div>modparam(&quot;acc&quot;, &quot;early_media&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;report_ack&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 0)</div><div>modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)</div>

<div>modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;log_level&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 1)</div>

<div>modparam(&quot;acc&quot;, &quot;db_flag&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, 2)</div><div>modparam(&quot;acc&quot;, &quot;aaa_url&quot;, &quot;radius:/etc/radiusclient-ng/radiusclient.conf&quot;) # Point the configuration file</div>

<div>modparam(&quot;acc&quot;, &quot;service_type&quot;, 15) # Set the service_type to 15</div><div>modparam(&quot;acc&quot;, &quot;aaa_flag&quot;, 1)</div><div>modparam(&quot;acc&quot;, &quot;aaa_missed_flag&quot;, 1)</div>

<div>modparam(&quot;acc&quot;, &quot;aaa_extra&quot;,           &quot;via=$hdr(Via[*]); \</div><div><span style="white-space:pre-wrap">                                </span>       Digest-User-Name=$Au; \</div><div>                                       Calling-Station-Id=$from; \</div>

<div>                                       Called-Station-Id=$to; \</div><div>                                       Sip-Translated-Request-URI=$ru; \</div><div>                                       Sip-RPid=$avp(s:rpid); \</div>

<div>                                       Source-IP=$avp(s:source_ip); \</div><div>                                       Source-Port=$avp(s:source_port); \</div><div>                                       SIP-Proxy-IP=$avp(s:sip_proxy_ip); \</div>

<div>                                       Canonical-URI=$avp(s:can_uri); \</div><div>                                       Divert-Reason=$avp(s:divert_reason); \</div><div>                                       User-Agent=$hdr(user-agent); \</div>

<div>                                       Contact=$hdr(contact); \</div><div>                                       Event=$hdr(event); \</div><div>                                       ENUM-TLD=$avp(s:enum_tld)&quot;)</div>

<div><br></div><div># ----- radius params ----</div><div>modparam(&quot;aaa_radius&quot;, &quot;radius_config&quot;,&quot;/etc/radiusclient-ng/radiusclient.conf&quot;)</div><div><br></div><div># ----- siptrace params ----</div>

<div>modparam(&quot;siptrace&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;siptrace&quot;, &quot;traced_user_avp&quot;, &quot;$avp(s:user)&quot;)</div><div>

modparam(&quot;siptrace&quot;, &quot;trace_table_avp&quot;, &quot;$avp(s:siptrace_table)&quot;)</div><div>modparam(&quot;siptrace&quot;, &quot;trace_on&quot;,        1)</div><div>modparam(&quot;siptrace&quot;, &quot;trace_flag&quot;,      22)</div>

<div>modparam(&quot;siptrace&quot;, &quot;enable_ack_trace&quot;, 1)</div><div><br></div><div><br></div><div># ----- auth_db params -----</div><div>/* uncomment the following lines if you want to enable the DB based</div>

<div>   authentication */</div><div><br></div><div>modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)</div><div>modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)</div><div><br></div>

<div>modparam(&quot;auth_db&quot;, &quot;db_url&quot;,&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div><div>modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;&quot;)</div><div><br></div><div>

<br></div><div>####### Routing Logic ########</div><div><br></div><div><br></div><div># main request routing logic</div><div><br></div><div>route{</div><div><br></div><div><span style="white-space:pre-wrap">        </span>setflag(22);</div>

<div>        sip_trace();</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (!mf_process_maxfwd_header(&quot;10&quot;)) {</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>#---- Sequential requests section ----#</div><div>
<br></div><div><span style="white-space:pre-wrap">        </span>if (has_totag()) {</div><div><span style="white-space:pre-wrap">                </span># sequential request withing a dialog should</div><div>
<span style="white-space:pre-wrap">                </span># take the path determined by record-routing</div><div><span style="white-space:pre-wrap">                </span>if (loose_route()) {</div><div><span style="white-space:pre-wrap">                        </span>if (is_method(&quot;BYE&quot;)) {</div>

<div><span style="white-space:pre-wrap">                                </span>setflag(1); # do accounting ...</div><div><span style="white-space:pre-wrap">                                </span>setflag(3); # ... even if the transaction fails</div>
<div><span style="white-space:pre-wrap">                                </span>} else if (is_method(&quot;INVITE&quot;)) {</div><div><span style="white-space:pre-wrap">                                </span># even if in most of the cases is useless, do RR for</div>
<div><span style="white-space:pre-wrap">                                </span># re-INVITEs alos, as some buggy clients do change route set</div><div><span style="white-space:pre-wrap">                                </span># during the dialog.</div>
<div><span style="white-space:pre-wrap">                                </span>record_route();</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                        </span># route it out to whatever destination was set by loose_route()</div>

<div><span style="white-space:pre-wrap">                        </span># in $du (destination URI).</div><div><span style="white-space:pre-wrap">                        </span>route(1);</div><div><span style="white-space:pre-wrap">                </span>} else {</div>
<div><span style="white-space:pre-wrap">                        </span>if ( is_method(&quot;ACK&quot;) ) {</div><div><span style="white-space:pre-wrap">                                </span>if ( t_check_trans() ) {</div><div><span style="white-space:pre-wrap">                                        </span>t_relay();</div>

<div><span style="white-space:pre-wrap">                                        </span>exit;</div><div><span style="white-space:pre-wrap">                                </span>} else {</div><div><span style="white-space:pre-wrap">                                        </span>exit;</div>
<div><span style="white-space:pre-wrap">                                </span>}</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div><br></div><div><br></div><div>#---- initial requests section ----#</div><div><br></div><div><span style="white-space:pre-wrap">        </span># CANCEL processing</div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;CANCEL&quot;))</div>

<div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                        </span>if (t_check_trans())</div><div><span style="white-space:pre-wrap">                        </span>t_relay();</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>t_check_trans();</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>if (!(method==&quot;REGISTER&quot;) &amp;&amp; from_uri==myself) /*no multidomain version*/</div><div><span style="white-space:pre-wrap">        </span>if (!(method==&quot;REGISTER&quot;) &amp;&amp; is_from_local())  /*multidomain version*/</div>

<div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>if (!proxy_authorize(&quot;&quot;, &quot;subscriber&quot;)) {</div><div><span style="white-space:pre-wrap">                        </span>proxy_challenge(&quot;&quot;, &quot;0&quot;);</div>

<div><span style="white-space:pre-wrap">                        </span>exit;</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span>if (!db_check_from()) {</div>
<div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);</div><div><span style="white-space:pre-wrap">                        </span>exit;</div><div><span style="white-space:pre-wrap">                </span>}</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">                </span>consume_credentials();</div><div><span style="white-space:pre-wrap">                </span># caller authenticated</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><br></div><div>#------------------ preloaded route checking ---------------------#</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (loose_route()) {</div>

<div><span style="white-space:pre-wrap">                </span>xlog(&quot;L_ERR&quot;,</div><div><span style="white-space:pre-wrap">                </span>&quot;Attempt to route with preloaded Route&#39;s [$fu/$tu/$ru/$ci]&quot;);</div>
<div><span style="white-space:pre-wrap">                </span>if (!is_method(&quot;ACK&quot;))</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;403&quot;,&quot;Preload Route denied&quot;);</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># record routing</div>
<div><span style="white-space:pre-wrap">        </span>if (!is_method(&quot;REGISTER|MESSAGE&quot;))</div><div><span style="white-space:pre-wrap">                </span>record_route();</div><div><br></div><div>
<span style="white-space:pre-wrap">        </span># account only INVITEs</div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;INVITE&quot;)) {</div><div><span style="white-space:pre-wrap">                </span>setflag(1); # do accounting</div>

<div><span style="white-space:pre-wrap">                </span>setflag(2); # Account Missed Calls</div><div><span style="white-space:pre-wrap">                </span>setflag(3); # Account Failed Transactions<span style="white-space:pre-wrap">        </span></div>

<div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>if (!uri==myself)</div><div><br></div><div><br></div><div>#---- Routing to external domains ----#</div>
<div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>## replace with following line if multi-domain support is used</div><div><span style="white-space:pre-wrap">        </span>if (!is_uri_host_local())</div>

<div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>if(is_from_local()) {</div><div><span style="white-space:pre-wrap">                </span>route(1);</div>
<div><span style="white-space:pre-wrap">                </span>} else {</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;403&quot;,&quot;Not here&quot;);</div><div><span style="white-space:pre-wrap">                </span>}</div>

<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">                </span>append_hf(&quot;P-hint: outbound\r\n&quot;); </div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;PUBLISH&quot;))</div>

<div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;$rc&quot;, &quot;Service Unavailable&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div>

<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span></div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (is_method(&quot;REGISTER&quot;))</div>
<div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span># authenticate the REGISTER requests (uncomment to enable auth)</div><div><span style="white-space:pre-wrap">                </span>if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;))</div>

<div><span style="white-space:pre-wrap">                </span>{</div><div><span style="white-space:pre-wrap">                        </span>www_challenge(&quot;&quot;, &quot;0&quot;);</div><div><span style="white-space:pre-wrap">                        </span>exit;</div>
<div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>if (!db_check_to()) </div>
<div><span style="white-space:pre-wrap">                </span>{</div><div><span style="white-space:pre-wrap">                        </span>sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);</div><div><span style="white-space:pre-wrap">                        </span>exit;</div>

<div><span style="white-space:pre-wrap">                </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                </span>if (!save(&quot;location&quot;))</div><div><span style="white-space:pre-wrap">                        </span>sl_reply_error();</div>

<div><br></div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if ($rU==NULL) {</div>
<div><span style="white-space:pre-wrap">                </span># request with no Username in RURI</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;484&quot;,&quot;Address Incomplete&quot;);</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span># apply DB based aliases (uncomment to enable)</div>

<div><span style="white-space:pre-wrap">        </span>alias_db_lookup(&quot;dbaliases&quot;);</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>if(!dp_translate(&quot;0&quot;,&quot;$rU/$rU&quot;)){</div>

<div><span style="white-space:pre-wrap">        </span>  send_reply(&quot;420&quot;, &quot;Invalid Destination&quot;);</div><div><span style="white-space:pre-wrap">        </span>  exit;</div><div><span style="white-space:pre-wrap">        </span>}</div>

<div><span style="white-space:pre-wrap">        </span>xlog(&quot;$avp(s:dest)&quot;);</div><div><span style="white-space:pre-wrap">        </span>if ($avp(s:dest)==&quot;usrloc&quot;) {</div><div><span style="white-space:pre-wrap">        </span>  #Route to usrloc</div>

<div><span style="white-space:pre-wrap">        </span>  route(3);</div><div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>if ($avp(s:dest)==&quot;pstn&quot;) {</div>
<div><span style="white-space:pre-wrap">        </span>  #route to pstn</div><div><span style="white-space:pre-wrap">        </span>  route(4);</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div><span style="white-space:pre-wrap">        </span>if ($avp(s:dest)==&quot;media&quot;) {</div><div><span style="white-space:pre-wrap">        </span>  #route to media server</div><div><span style="white-space:pre-wrap">        </span>  route(5);</div>

<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>send_reply(&quot;420&quot;, &quot;Invalid Extension&quot;);</div><div><span style="white-space:pre-wrap">        </span>  exit;</div>

<div>      }</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>route[1] {</div><div><br></div><div><br></div><div>          load_balance(&quot;2&quot;,&quot;sip&quot;);</div>
<div>        }</div><div><br></div><div>        # LB function returns negative if no suitable destination (for requested resources) is found,</div><div>        # or if all destinations are full</div><div>        if ($retcode&lt;0) {</div>

<div>             sl_send_reply(&quot;500&quot;,&quot;Service full&quot;);</div><div>             exit;</div><div>        }</div><div><br></div><div>        xlog(&quot;Selected destination is: $du\n&quot;);</div><div><br>

</div><div>        # send it out</div><div>        if (!t_relay()) {</div><div>                sl_reply_error();</div><div>        }</div><div>#        }</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span># for INVITEs enable some additional helper routes</div>

<div><br></div><div><br></div><div><span style="white-space:pre-wrap">                </span>if (is_method(&quot;INVITE&quot;)) {</div><div><span style="white-space:pre-wrap">                </span>t_on_branch(&quot;2&quot;);</div>
<div><span style="white-space:pre-wrap">                </span>t_on_reply(&quot;2&quot;);</div><div><span style="white-space:pre-wrap">                </span>t_on_failure(&quot;1&quot;);</div><div><span style="white-space:pre-wrap">        </span>     }</div>

<div><span style="white-space:pre-wrap">        </span>     if (!t_relay()) {</div><div><span style="white-space:pre-wrap">                </span>sl_reply_error();</div><div><span style="white-space:pre-wrap">        </span>     };</div>
<div><span style="white-space:pre-wrap">        </span>     exit;</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>xlog(&quot;Selected destination is: $du\n&quot;);</div>
<div><br></div><div>        # send it out</div><div><span style="white-space:pre-wrap">        </span>if (!t_relay()) {</div><div><span style="white-space:pre-wrap">                </span>sl_reply_error();</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>#Route for user lookups</div><div><br></div><div>route[3]{</div>
<div><span style="white-space:pre-wrap">        </span>if (!lookup(&quot;location&quot;, &quot;m&quot;)) {</div><div><span style="white-space:pre-wrap">        </span>switch ($retcode) {</div><div><span style="white-space:pre-wrap">        </span>case -1:</div>

<div><span style="white-space:pre-wrap">        </span>case -3:</div><div><span style="white-space:pre-wrap">                </span>t_newtran();</div><div><span style="white-space:pre-wrap">                </span>t_reply(&quot;404&quot;, &quot;Not Found&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>case -2:</div><div><span style="white-space:pre-wrap">                </span>sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>exit;<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>}</div><div>      }</div>
<div><span style="white-space:pre-wrap">        </span># when routing via usrloc, log the missed calls also</div><div><span style="white-space:pre-wrap">        </span>setflag(2);</div><div><span style="white-space:pre-wrap">        </span>route(1);</div>

<div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>route[4] {</div><div><span style="white-space:pre-wrap">        </span>#---- PSTN route ----#</div><div><span style="white-space:pre-wrap">        </span>if(!do_routing()){</div>

<div><span style="white-space:pre-wrap">                </span>send_reply(&quot;503&quot;, &quot;No rules found matching the URI prefix&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span># flag 10 - route to pstn</div><div><span style="white-space:pre-wrap">                </span>setflag(10);</div>
<div><span style="white-space:pre-wrap">                </span>route(1);</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div>route[5] {</div><div><span style="white-space:pre-wrap">        </span>#---- Route to media servers ----#</div>

<div><span style="white-space:pre-wrap">        </span>xlog(&quot;route to media servers&quot;);</div><div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>branch_route[2] {</div>

<div><span style="white-space:pre-wrap">                </span>xlog(&quot;new branch at $ru\n&quot;);</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>onreply_route[2] {</div>

<div><span style="white-space:pre-wrap">                </span>xlog(&quot;incoming reply\n&quot;);</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>failure_route[1] {</div>
<div><span style="white-space:pre-wrap">                </span>if (t_was_cancelled()) {</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div><span style="white-space:pre-wrap">        </span>if(isflagset(10)){</div><div><span style="white-space:pre-wrap">                </span>if (use_next_gw()) {</div><div><span style="white-space:pre-wrap">                </span>xlog (&quot;next gateway $ru \n&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>t_on_failure(&quot;1&quot;);</div><div><span style="white-space:pre-wrap">                </span>t_relay();</div><div><span style="white-space:pre-wrap">                </span>exit;</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>else {</div><div><span style="white-space:pre-wrap">                </span>t_reply(&quot;$rc&quot;, &quot;Service not available, no more gateways&quot;);</div>

<div><span style="white-space:pre-wrap">                </span>#t_reply(&quot;$T_reply_code&quot;);</div><div><span style="white-space:pre-wrap">                </span>exit;</div><div><span style="white-space:pre-wrap">                </span>}</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div></div><div><div></div><div class="h5"><div><br></div><div><br><div class="gmail_quote">On Sun, Jun 12, 2011 at 9:57 PM, Robert Thomas <span dir="ltr">&lt;<a href="mailto:thomcr@gmail.com" target="_blank">thomcr@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you please share your opensips.cfg file<br><br><div class="gmail_quote"><div><div></div><div>On Sun, Jun 12, 2011 at 10:20 AM, Tushar Jain <span dir="ltr">&lt;<a href="mailto:tusshar.jain@gmail.com" target="_blank">tusshar.jain@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div>I am trying to make opensips&#39;s load balancer work with 2 sip server(voip switch). load balancer module was able to locate the sip servers and their resources but as soon as resources of the first voip server exhausts I start getting error &quot;call failed service full&quot; and opensips start connecting calls again only after restarting the services of opensips.</div>



<div><br></div><div>I tried to go through the logs and found a error that load balancer is not able to create dialog. I tried to look for this error without any success.</div><div><br></div><div>ERROR:load_balancer:do_load_balance: failed to create dialog</div>



<div><br></div><div><br></div>Please help me in making my load balancer work properly.<br>-- <br>Thanks &amp; Regards<br> <br>Tushar Jain<br><br> <br>&quot;two roads diverged in a wood, and I - I took the one less traveled by, and that has made all the difference&quot; <br>



 <br>--Robert Frost &quot; <br>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Robert<br>
</font><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Regards<br> <br>Tushar Jain<br><br> <br>&quot;two roads diverged in a wood, and I - I took the one less traveled by, and that has made all the difference&quot; <br> <br>

--Robert Frost &quot; <br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards<br> <br>Tushar Jain<br><br> <br>&quot;two roads diverged in a wood, and I - I took the one less traveled by, and that has made all the difference&quot; <br>
 <br>--Robert Frost &quot; <br>