Great. Thank you Vlad.<div><br><br><div class="gmail_quote">On Thu, Aug 30, 2012 at 10:32 AM, Vlad Paiu <span dir="ltr">&lt;<a href="mailto:vladpaiu@opensips.org" target="_blank">vladpaiu@opensips.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Hi Ali,<br>
    <br>
    Yes, those AVPs are properly populated after use_next_gw(). <br>
    <br>
    Regards,<br>
    <pre cols="72">Vlad Paiu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a> </pre><div><div class="h5">
    <br>
    On 08/30/2012 05:12 PM, Ali Pey wrote:
    <blockquote type="cite">Hi Bogdan,
      <div><br>
      </div>
      <div>Does <span style="font-family:Helvetica,Arial">use_next_gw() in drouting
          module adjust</span> the values for gw_id_avp and gw_attrs_avp
        parameters?</div>
      <div>
        <br>
      </div>
      <div>I need to use this function if the max concurrent call limit
        has reached for the current gw, then evaluate the number of
        concurrent calls on the next gateway until there is no other
        gateways.</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div>Ali Pey</div>
      <div><br>
      </div>
      <div><br>
        <div class="gmail_quote">On Wed, Aug 29, 2012 at 12:37 PM,
          Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div bgcolor="#ffffff" text="#000000"> <tt>Hi Ali,<br>
                <br>
                For profiling, use the GW ID - as value for the profile
                - (you can instruct DR to return the GW ID in an AVP) ;
                now, about the limit, use the &quot;attrs&quot; from GWs to keep
                it<br>
                <br>
                Regards,<br>
              </tt>
              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              <div>
                <div> <br>
                  On 08/29/2012 07:35 PM, Ali Pey wrote:
                  <blockquote type="cite">Hi Jeff,
                    <div><br>
                    </div>
                    <div>Thank you for the reply but unfortunately this
                      doesn&#39;t answer my questions. I need to bind this
                      to the drouting module, so when I call do_routing,
                      I need a parameter for set_dialog_profile for
                      whatever gateway do_routing() picks. That was my
                      first and second questions.</div>
                    <div><br>
                    </div>
                    <div>Also in your case, where do you set
                      $var(dlgsize_out)? where do you get it from? How
                      would you change it? I don&#39;t want to have to
                      change my script or restart opensips to change
                      this.</div>
                    <div><br>
                    </div>
                    <div>Regards,</div>
                    <div>Ali Pey</div>
                    <div><br>
                    </div>
                    <div><br>
                      <div class="gmail_quote">On Wed, Aug 29, 2012 at
                        12:27 PM, Jeff Pyle <span dir="ltr">&lt;<a href="mailto:jpyle@fidelityvoice.com" target="_blank">jpyle@fidelityvoice.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                          <div>Ali,</div>
                          <div><br>
                          </div>
                          <div>Oops, I had some inconsistent rewrites.
                             So much for improved readability.  Consider
                            this instead:</div>
                          <div><br>
                          </div>
                          <div>
                            <div><font face="courier new, monospace" size="1">        # Check to see if we&#39;re
                                at maximum capacity for this gateway</font></div>
                            <div>
                              <div><font face="courier new, monospace" size="1">        if
                                  !(get_profile_size(&quot;outbound&quot;,
                                  &quot;$avp(s:dlgid_out)&quot;,
                                  &quot;$var(dlgsize_out)&quot;)) {</font></div>
                              <div><font face="courier new, monospace" size="1">               
                                  xlog(&quot;L_INFO&quot;, &quot;Couldn&#39;t get dialog
                                  size, continuing route-out\n&quot;);</font></div>
                              <div><font face="courier new, monospace" size="1">        } else {</font></div>
                            </div>
                            <div><font face="courier new, monospace" size="1">                if
                                (is_avp_set(&quot;$avp(s:gw_maxcalls)&quot;)
                                &amp;&amp; $var(dlgsize_out) &gt;=
                                $avp(s:gw_maxcalls)) {</font></div>
                            <div><font face="courier new, monospace" size="1">                        # We&#39;re
                                full, so cycle around to the next
                                gateway...</font></div>
                            <div><font face="courier new, monospace" size="1">                }</font></div>
                            <div><font face="courier new, monospace" size="1">        }</font></div>
                          </div>
                          <div><br>
                          </div>
                          <div>That should make more sense.</div>
                          <span><font color="#888888">
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div>- Jeff</div>
                            </font></span>
                          <div>
                            <div>
                              <div><br>
                              </div>
                              <br>
                              <br>
                              <br>
                              <div class="gmail_quote">On Wed, Aug 29,
                                2012 at 12:24 PM, Jeff Pyle <span dir="ltr">&lt;<a href="mailto:jpyle@fidelityvoice.com" target="_blank">jpyle@fidelityvoice.com</a>&gt;</span>
                                wrote:<br>
                                <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                  <div>Hi Ali,</div>
                                  <div><br>
                                  </div>
                                  <div>I have the same application.  A
                                    little before the <font face="courier new, monospace">t_relay()</font>
                                    to the gateway, I have:</div>
                                  <div>
                                    <div><br>
                                    </div>
                                    <div><font face="courier new,
                                        monospace" size="1">        #
                                        Check to see if we&#39;re at maximum
                                        capacity</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">        if
                                        !(get_profile_size(&quot;outbound&quot;,
                                        &quot;$avp(s:dlgid_out)&quot;,
                                        &quot;$var(dlgsize_out)&quot;)) {</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">           
                                            xlog(&quot;L_INFO&quot;, &quot;Couldn&#39;t get
                                        dialog size, continuing
                                        route-out\n&quot;);</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">        }
                                        else {</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">           
                                            if
                                        (is_avp_set(&quot;$avp(s:gw_maxcalls)&quot;)
                                        &amp;&amp; $var(dlgsize_out)
                                        &gt;= $avp(s:car_maxcalls)) {</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">           
                                                    # Move on to the
                                        next carrier...</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">           
                                                   </font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">           
                                            }</font></div>
                                    <div><font face="courier new,
                                        monospace" size="1">        }</font></div>
                                  </div>
                                  <div><font face="courier new,
                                      monospace" size="1">        #
                                      Continue towards t_relay() for
                                      this gateway...</font></div>
                                  <div><br>
                                  </div>
                                  <div>This verifies our counts to make
                                    sure we have room.  If I&#39;m at that
                                    value (or over) I cycle around and
                                    select the next gateway.  If all is
                                    well I run <font face="courier new,
                                      monospace">set_dlg_profile(&quot;outbound&quot;,

                                      &quot;</font><span>$avp(s:dlgid_out)</span><font face="courier new, monospace">&quot;)</font>.
                                     Since you&#39;re using drouting,
                                    perhaps you&#39;ll use another variable
                                    here in place of <span>$avp(s:dlgid_out)</span>.</div>
                                  <div><br>
                                  </div>
                                  <div>I implement serial forking for my
                                    gateways.  In the selected
                                    failure_route I run <font face="courier new, monospace">unset_dlg_profile(&quot;outbound&quot;,

                                      &quot;$avp(s:dlgid_out)&quot;)</font>.  If
                                    I&#39;m in this section I know the call
                                    has failed, so I want to remove its
                                    count from the profile.</div>
                                  <div><br>
                                  </div>
                                  <div>This configure is old enough to
                                    be pre-drouting but the concepts are
                                    still the same.</div>
                                  <div><br>
                                  </div>
                                  <div>Is that helpful?</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>- Jeff</div>
                                  <div><br>
                                  </div>
                                  <br>
                                  <br>
                                  <div class="gmail_quote">
                                    <div>
                                      <div>On Wed, Aug 29, 2012 at 11:53
                                        AM, Ali Pey <span dir="ltr">&lt;<a href="mailto:alipey@gmail.com" target="_blank">alipey@gmail.com</a>&gt;</span>
                                        wrote:<br>
                                      </div>
                                    </div>
                                    <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                      <div>
                                        <div> Hi All,
                                          <div><br>
                                          </div>
                                          <div>I would like to limit
                                            number of concurrent calls
                                            to a gateway in dr_gateways
                                            table (drouting module).</div>
                                          <div><br>
                                          </div>
                                          <div>I have looked at the
                                            tutorial on the opensips
                                            webiste (<a href="http://www.opensips.org/Resources/DocsTutConcurrentCalls" target="_blank">http://www.opensips.org/Resources/DocsTutConcurrentCalls</a>)
                                            and this is not the same. </div>
                                          <div><br>
                                          </div>
                                          <div>I do create a dialog and
                                            then I do do_routing(). At
                                            this point I don&#39;t know:</div>
                                          <div><br>
                                          </div>
                                          <div>1- What parameters to
                                            pass to set_dlg_profile() to
                                            increase the number of calls
                                            for whatever particular
                                            gateway do_routing happened
                                            to select?</div>
                                          <div><br>
                                          </div>
                                          <div>2- How to
                                            use get_profile_size() to
                                            see if the gateway has
                                            reached it&#39;s maximum number
                                            of channels?</div>
                                          <div><br>
                                          </div>
                                          <div>3- Where would be the
                                            best place to record and
                                            read the max number of
                                            channels available for each
                                            gateway? some place that I
                                            wouldn&#39;t need to do a db
                                            quey but I would be able to
                                            make changes while opensips
                                            is running similar to the
                                            drouting module parameters
                                            itself.</div>
                                          <div><br>
                                          </div>
                                          <div><br>
                                          </div>
                                          <div>Any help/suggestion would
                                            be appreciated.</div>
                                          <div><br>
                                          </div>
                                          <div>Thanks,</div>
                                          <div>Ali Pey</div>
                                          <div><br>
                                          </div>
                                          <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>
                                </blockquote>
                              </div>
                              <br>
                            </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>
                    <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                  </blockquote>
                </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>
      <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </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>