Hi Ali,<div><br></div><div>Well first of I felt a bit reluctant to reply after reading your reply to Binan...didn&#39;t want to hear something like that for anyone on the list which I am part of. Neither I wish us to continue this thing further in this thread.</div>
<div><br></div><div>Ok coming back to the concern, I only know that dispatcher module has something like grp_avp modparam, which after selecting a destination gateway sets its group-id in that avp.</div><div><br></div><div>
If DB query is not required then possible options limit to using the memcache/redis for storing contents of Load-balancer table and doing a redis based query. Other option is use FIFO/MI_XMLRPC stuff from a perl script and have it return to you the group-id of the input gateway address. Then call the perl script in your config. That won&#39;t be as much of a overhead compared to DB query.</div>
<div><br></div><div>BR</div><div>Sammy</div><div><br></div><div><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 10:14 PM, Ali Pey <span dir="ltr">&lt;<a href="mailto:alipey@gmail.com" target="_blank">alipey@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 Sammy,<div><br></div><div>Thank you for your response and it is a very good suggestion. I&#39;m sorry if you felt I was criticizing it.</div>
<div><br></div><div>I know there is a way to increase the number of active call for the load balancer module:</div>
<div><br></div><div>set_dlg_profile(&quot;lbXchannel&quot;,&quot;server_id)&quot;);</div><div><br></div><div>I just don&#39;t know how I can get the server_id which is the load_balancer table index without doing a DB query.</div>

<div><br></div><div>Thanks again,</div><div>Ali</div><div class="HOEnZb"><div class="h5"><div><br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 12:56 PM, SamyGo <span dir="ltr">&lt;<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@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"><div>Hi,</div><div><br></div>Didn&#39;t understand you clearly. <div><br></div><div>When you define a size i.e calls=100 per gateway and you send a call from opensips to that gateway its load becomes 1, and capacity obviously becomes calls=99. Now, When you gateway sends call back and you increment its call count variable $avp(IC_GW1) to 1 AND immediately resize the capacity like calls = calls - 1; The capacity of your gateway become calls=98.<div>


<br></div><div>On hangup of that Incoming call from gateway you resize the capacity back. </div><div><br></div><div>Using Dialog module profiling you can do it easily.<br><div><br></div><div>And as per my understanding of your question this is what you wanted. I am not sure if there is any clean way of doing this w/o going into the load_balancer module code and editing it as per your requirement which will be something like : Link the load_balancer module with the dialog module. Create a modparam like &quot;gw_incoming_call_monitor&quot;= 1 | 0. if its set to 1, internally tell dialog module to count the active incoming calls of each load-balancer gateway and adjust the gateway&#39;s &quot;load&quot;. I don&#39;t think this is much of a big task.</div>


<div><br></div><div>Do spare me sir if you didn&#39;t like it.</div><div><br></div><div>Thanks,</div><div>Sammy</div><div><div><div> <br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 9:37 PM, Ali Pey <span dir="ltr">&lt;<a href="mailto:alipey@gmail.com" target="_blank">alipey@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 Sammy,<div><br></div><div>I rather to be able to see the through number of active calls on a server than re-sizing the capacity of each server twice for each call. That will create a mess.</div>


<div><br></div><div>Regards,</div>
<div>Ali Pey</div><div><div><div><br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 12:02 PM, SamyGo <span dir="ltr">&lt;<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@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 Ali,<div><br></div><div>No , I said it dialog based profiling of each gateway&#39;s incoming calls to opensips. Store the call counter for each gateway in any variable, I named it $avp(IC_GW1).</div><div>Next is use this: <a href="http://www.opensips.org/html/docs/modules/1.8.x/load_balancer.html#id250348" target="_blank">http://www.opensips.org/html/docs/modules/1.8.x/load_balancer.html#id250348</a></div>




<div>Resize a particular gateway&#39;s capacity using simple maths.</div><div><br></div><div><br></div><div>Thanks,</div><div>Sammy</div><div><div><div> </div><div><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 8:30 PM, Muhammad Shahzad <span dir="ltr">&lt;<a href="mailto:shaheryarkh@googlemail.com" target="_blank">shaheryarkh@googlemail.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 give more info about your topology, I think everybody is considering following topology,<div><br></div><div>caller -&gt; opensips -&gt; gateway -&gt; opensips -&gt; destination<br>




<div><br></div><div>Which means call enter opensips twice, once for leg A and once for leg B. Is that what you have? If yes, then do you want to count leg A and leg B for each call?</div>
<div><br></div><div>Thank you.</div><div><div><div><br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 5:20 PM, Ali Pey <span dir="ltr">&lt;<a href="mailto:alipey@gmail.com" target="_blank">alipey@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 Binan,<div><br></div><div>Sometimes I wish you would read the question before trying to answer. If you don&#39;t have an answer, you don&#39;t need to come up with one. No body is forcing you.</div>





<div><br></div><div>1- First of all, how is this related to load balancer modules? As you can see the title of email is talking about the load balancer module.</div>
<div>2- All my GW IP addresses are in the database, I don&#39;t want to list them in my config file and evey time these is s change I would have to change the config file and restart the service.</div><div>3- I need a solution that would integrate with load balacer module and/or the dialog module so I can use the MI commands and it would be automatic. What you are saying here doesn&#39;t have a real world practice.</div>






<div><br></div><div>Thanks,</div><div>Ali</div><div><div><div><br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 5:09 AM, Binan AL Halabi <span dir="ltr">&lt;<a href="mailto:binanalhalabi@yahoo.com" target="_blank">binanalhalabi@yahoo.com</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Hi,<strong><br><br>





$si</strong> - reference to IP source address of the message
<br><pre> if ($si==GW1-IP-ADDRESS) {
     # Incoming call<br>     # Increment $avp(IC_GW1)<br><br> } </pre>//Binan<br><br>--- On <b>Thu, 9/6/12, SamyGo <i>&lt;<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px">






<br>From: SamyGo &lt;<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>&gt;<br>Subject: Re: [OpenSIPS-Users] Can load balancer show total number of call for a gateway<br>To: &quot;OpenSIPS users mailling list&quot; &lt;<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>&gt;<br>






Date: Thursday, September 6, 2012, 10:25 PM<div><div><br><br><div>Hi Ali,<div><br></div><div>AFAIK you can&#39;t do this from Load-balancer, but the possible solution is use variable $avp(IC_GW1) for each gateway to count the incoming calls from particular gateways (Dialogue module based profiling) and then see how many calls a gateway has Incoming/Outgoing from/to a particular gateway.</div>







<div><br>The real deal is to communicate the populated incoming calls variable to the load-balancer module. (Dynamically increment/decrement a g/w capacity based on the $avp(IC_GW1) )</div><div><br></div><div>BR<br>Sammy</div>







<div><br><br><div>On Fri, Sep 7, 2012 at 1:58 AM, Ali Pey <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=alipey@gmail.com" target="_blank">alipey@gmail.com</a>&gt;</span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







Hello,<div><br></div><div>Let&#39;s say I have a sip trunk with 100 channels. The calls come in and are distributed to 4 gateways through the load_balancer module. Load balancer module can show all active call going to the gateways but not the call originated from the gateways to a sip trunk.</div>








<div><br></div><div>If there are outgoing calls from the gateways to the sip trunks, those will not be accounted for on the load balancer module. Basically load balancer can keep account for number of active calls on one direction.</div>








<div><br></div><div>Is there a way that I can see the total number of active calls on a gateway (both incoming and outgoing) through the load balancer module?</div><div><br></div><div>Regards,</div><div>Ali Pey</div><div>








<br></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a rel="nofollow" href="http://mc/compose?to=Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a rel="nofollow" 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></div>
</div><br></div></div>-----Inline Attachment Follows-----<div><br><br><div>_______________________________________________<br>Users mailing list<br><a href="http://mc/compose?to=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></div></div></blockquote></td></tr></tbody></table><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></div>
</div></div><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"><div><br></div>-- <br></div></div><span><font color="#888888">Muhammad Shahzad<br>-----------------------------------<br>CISCO Rich Media Communication Specialist (CRMCS)<br>
CISCO Certified Network Associate (CCNA)<br>
Cell: <a href="tel:%2B92%20334%20422%2040%2088" value="+923344224088" target="_blank">+92 334 422 40 88</a><br>MSN: <a href="mailto:shari_786pk@hotmail.com" target="_blank">shari_786pk@hotmail.com</a><br>Email: <a href="mailto:shaheryarkh@googlemail.com" target="_blank">shaheryarkh@googlemail.com</a><br>





</font></span></div></div>
<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></div>
</div></div><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></div>
</div></div><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></div></div></div></div></div>
<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></div>
</div></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><br></div>