<p dir="ltr">Hi Mohammad,</p>
<p dir="ltr">In the load_balance mysql table you&#39;ve defined your resources as sip and pstn but in the script you are telling opensips to load balance with another resource &quot;channels&quot;.</p>
<p dir="ltr">Try changing line 227 of your script to this:</p>
<p dir="ltr">                if ( load_balance(&quot;1&quot;,&quot;pstn&quot;) ) {<br></p>
<p dir="ltr">Regards,</p>
<p dir="ltr">Peter</p>
<div class="gmail_quote">On 12 Jan 2015 16:21, &quot;Mohammad Sajedi&quot; &lt;<a href="mailto:mohammad.sajedi@overturenetworks.com">mohammad.sajedi@overturenetworks.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hi Bogdan,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have created three servers, and connected them in the following topology:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="color:#c00000">SIPp </span>(<a href="http://10.241.88.34/27" target="_blank">10.241.88.34/27</a>) ------------ (<a href="http://10.241.88.36/27" target="_blank">10.241.88.36/27</a>)
<span style="color:#c00000">OpenSIPs </span>(<a href="http://10.241.88.68/27" target="_blank">10.241.88.68/27</a>) ------------------- (<a href="http://10.241.88.67/27" target="_blank">10.241.88.67/27</a>)
<span style="color:#c00000">Asterisk</span><u></u><u></u></p>
<p class="MsoNormal">                                                                                                                                                               
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">On OpenSIPs<u></u><u></u></p>
<p class="MsoNormal">Have added  <span style="font-family:Wingdings">à</span> <span style="font-size:9.0pt;font-family:&quot;Lucida Console&quot;">
opensips_loadbalancer_2015-1-8_11\:43\:20.cfg</span>   file (see attached)<u></u><u></u></p>
<p class="MsoNormal">And changed the UDP listen line to:<u></u><u></u></p>
<p class="MsoNormal">listen=udp:<a href="http://10.241.88.36:5060" target="_blank">10.241.88.36:5060</a>   <span style="color:#c00000"># CUSTOMIZE ME<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#c00000"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#c00000">Also Added the following to MySQL<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Lucida Console&quot;">mysql -uopensips -popensipsrw opensips -e &quot;INSERT INTO load_balancer VALUES(1,1,&#39;sip:<a href="http://10.241.88.66:5060" target="_blank">10.241.88.66:5060</a>&#39;,&#39;pstn=500;sip=500&#39;,2,&#39;&#39;);&quot;</span><span style="color:#c00000"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#c00000"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#c00000"><u></u> <u></u></span></p>
<p class="MsoNormal">On Asterisk, added the following to the Asterisk configuration files:<u></u><u></u></p>
<p style="margin:0in;margin-bottom:.0001pt;line-height:18.0pt;background:white"><span style="font-size:9.0pt;font-family:&quot;Lucida Sans Unicode&quot;,sans-serif;color:#666666">/etc/asterisk/<span>extensions.conf</span><u></u><u></u></span></p>
<p style="margin:0in;margin-bottom:.0001pt;line-height:18.0pt;background:white;word-spacing:0px">
<code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">[sipp]</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">exten =&gt; 2005,1,Answer</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">exten =&gt; 2005,2,SetMusicOnHold(default)</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">exten =&gt; 2005,3,WaitMusicOnHold(20)</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">exten =&gt; 2005,4,Hangup</span></code><span style="font-size:9.0pt;font-family:&quot;Lucida Sans Unicode&quot;,sans-serif;color:#666666"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p style="margin:0in;margin-bottom:.0001pt;line-height:18.0pt;background:white"><span style="font-size:9.0pt;font-family:&quot;Lucida Sans Unicode&quot;,sans-serif;color:#666666">/etc/asterisk/<span>sip.conf</span><u></u><u></u></span></p>
<p style="margin:0in;margin-bottom:.0001pt;line-height:18.0pt;background:white;word-spacing:0px">
<code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">[sipp]</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">type=friend</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">context=sipp</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">host=dynamic</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">port=6000</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">user=sipp</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">canreinvite=no</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">disallow=all</span></code><span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:#666666;background:#eeeeff"><br>
</span><code><span style="font-size:11.5pt;color:#666666;background:#eeeeff">allow=ulaw</span></code><span style="font-size:9.0pt;font-family:&quot;Lucida Sans Unicode&quot;,sans-serif;color:#666666"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">On SIPp, issued:<u></u><u></u></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:&quot;Lucida Console&quot;">./sipp -sn uac -d 20000 -s 2005 10.241.88.36  -l 30<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The SIP packets are coming out of (<a href="http://10.241.88.68/27" target="_blank">10.241.88.68/27</a>) OpenSIPs interface with destination IP address of 10.241.88.36.<u></u><u></u></p>
<p class="MsoNormal">How can I configure OpenSIPs such that OpenSIPs changes the destination IP address to 10.241.88.66?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">Mohammad<u></u><u></u></p>
</div>
<br>
<br>
<font size="1">This email and attachments may contain privileged or confidential information intended only for the addressee(s) indicated. The sender does not waive any of its rights, privileges or protections respecting this information. If you are not the
 named addressee, an employee, or agent responsible for sending this message to the named addressee (or this message was received by mistake), you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If received in
 error, please notify us immediately by e-mail, discard any paper copies and delete all electronic files of the email.<br>
<br>
Computer viruses can be transmitted via email. The recipient should check this email and any attachments for viruses. Email transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive
 late or incomplete, or contain viruses. The sender accepts no liability for any damage caused by any transmitted viruses or errors or omissions in the contents of this message.<br>
<br>
Overture Networks, Inc. 637 Davis Drive, Morrisville, NC USA 27560 <a href="http://www.overturenetworks.com" target="_blank">www.overturenetworks.com</a></font>
</div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">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>