No subject


Wed Oct 26 15:22:07 CEST 2011


the failure route and I hadn't thought about that before. I'm sure more
people will benefit from your response in the future facing similar
question.

Regards,
Ali Pey


On Wed, Aug 29, 2012 at 1:01 PM, Jeff Pyle <jpyle at fidelityvoice.com> wrote:

> Bogdan's answer was much better...  :)
>
>
> - Jeff
>
>
> On Wed, Aug 29, 2012 at 12:45 PM, Ali Pey <alipey at gmail.com> wrote:
>
>> Thank you Bogdan. That answers all my questions.
>>
>> Regards,
>> Ali Pey
>>
>>
>> On Wed, Aug 29, 2012 at 12:37 PM, Bogdan-Andrei Iancu <
>> bogdan at opensips.org> wrote:
>>
>>> **
>>> Hi Ali,
>>>
>>> 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
>>> "attrs" from GWs to keep it
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>>
>>>
>>> On 08/29/2012 07:35 PM, Ali Pey wrote:
>>>
>>> Hi Jeff,
>>>
>>>  Thank you for the reply but unfortunately this doesn'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.
>>>
>>>  Also in your case, where do you set $var(dlgsize_out)? where do you
>>> get it from? How would you change it? I don't want to have to change my
>>> script or restart opensips to change this.
>>>
>>>  Regards,
>>> Ali Pey
>>>
>>>
>>> On Wed, Aug 29, 2012 at 12:27 PM, Jeff Pyle <jpyle at fidelityvoice.com>wrote:
>>>
>>>> Ali,
>>>>
>>>>  Oops, I had some inconsistent rewrites.  So much for improved
>>>> readability.  Consider this instead:
>>>>
>>>>          # Check to see if we're at maximum capacity for this gateway
>>>>          if !(get_profile_size("outbound", "$avp(s:dlgid_out)",
>>>> "$var(dlgsize_out)")) {
>>>>                 xlog("L_INFO", "Couldn't get dialog size, continuing
>>>> route-out\n");
>>>>         } else {
>>>>                  if (is_avp_set("$avp(s:gw_maxcalls)") &&
>>>> $var(dlgsize_out) >= $avp(s:gw_maxcalls)) {
>>>>                         # We're full, so cycle around to the next
>>>> gateway...
>>>>                 }
>>>>         }
>>>>
>>>>  That should make more sense.
>>>>
>>>>
>>>>  - Jeff
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Aug 29, 2012 at 12:24 PM, Jeff Pyle <jpyle at fidelityvoice.com>wrote:
>>>>
>>>>> Hi Ali,
>>>>>
>>>>>  I have the same application.  A little before the t_relay() to the
>>>>> gateway, I have:
>>>>>
>>>>>          # Check to see if we're at maximum capacity
>>>>>         if !(get_profile_size("outbound", "$avp(s:dlgid_out)",
>>>>> "$var(dlgsize_out)")) {
>>>>>                 xlog("L_INFO", "Couldn't get dialog size, continuing
>>>>> route-out\n");
>>>>>         } else {
>>>>>                 if (is_avp_set("$avp(s:gw_maxcalls)") &&
>>>>> $var(dlgsize_out) >= $avp(s:car_maxcalls)) {
>>>>>                         # Move on to the next carrier...
>>>>>
>>>>>                 }
>>>>>         }
>>>>>          # Continue towards t_relay() for this gateway...
>>>>>
>>>>>  This verifies our counts to make sure we have room.  If I'm at that
>>>>> value (or over) I cycle around and select the next gateway.  If all is well
>>>>> I run set_dlg_profile("outbound", "$avp(s:dlgid_out)").  Since you're
>>>>> using drouting, perhaps you'll use another variable here in place of
>>>>> $avp(s:dlgid_out).
>>>>>
>>>>>  I implement serial forking for my gateways.  In the selected
>>>>> failure_route I run unset_dlg_profile("outbound", "$avp(s:dlgid_out)").
>>>>>  If I'm in this section I know the call has failed, so I want to remove its
>>>>> count from the profile.
>>>>>
>>>>>  This configure is old enough to be pre-drouting but the concepts are
>>>>> still the same.
>>>>>
>>>>>  Is that helpful?
>>>>>
>>>>>
>>>>>  - Jeff
>>>>>
>>>>>
>>>>>
>>>>>  On Wed, Aug 29, 2012 at 11:53 AM, Ali Pey <alipey at gmail.com> wrote:
>>>>>
>>>>>>  Hi All,
>>>>>>
>>>>>>  I would like to limit number of concurrent calls to a gateway in
>>>>>> dr_gateways table (drouting module).
>>>>>>
>>>>>>  I have looked at the tutorial on the opensips webiste (
>>>>>> http://www.opensips.org/Resources/DocsTutConcurrentCalls) and this
>>>>>> is not the same.
>>>>>>
>>>>>>  I do create a dialog and then I do do_routing(). At this point I
>>>>>> don't know:
>>>>>>
>>>>>>  1- What parameters to pass to set_dlg_profile() to increase the
>>>>>> number of calls for whatever particular gateway do_routing happened to
>>>>>> select?
>>>>>>
>>>>>>  2- How to use get_profile_size() to see if the gateway has reached
>>>>>> it's maximum number of channels?
>>>>>>
>>>>>>  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'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.
>>>>>>
>>>>>>
>>>>>>  Any help/suggestion would be appreciated.
>>>>>>
>>>>>>  Thanks,
>>>>>> Ali Pey
>>>>>>
>>>>>>
>>>>>>  _______________________________________________
>>>>>> Users mailing list
>>>>>> Users at lists.opensips.org
>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>

--f46d04016a673bfcc704c86ae370
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Jeff,<div><br></div><div>Your answer was quite useful and thank you for tak=
ing the time to respond. From your response I learned that I need to reduce=
 the number of calls in the failure route and I hadn&#39;t thought about th=
at before. I&#39;m sure more people will benefit from your response in the =
future facing similar question.</div>
<div><br></div><div>Regards,</div><div>Ali Pey</div><div><br></div><div><br=
><div class=3D"gmail_quote">On Wed, Aug 29, 2012 at 1:01 PM, Jeff Pyle <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:jpyle at fidelityvoice.com" target=3D"_bla=
nk">jpyle at fidelityvoice.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>Bogdan&#39;s answer was much better... =
=A0:)</div><span class=3D"HOEnZb"><font color=3D"#888888"><div><br></div><d=
iv><br>
</div><div>- Jeff</div></font></span><div class=3D"HOEnZb"><div class=3D"h5=
"><div><br></div><br><div class=3D"gmail_quote">On Wed, Aug 29, 2012 at 12:=
45 PM, Ali Pey <span dir=3D"ltr">&lt;<a href=3D"mailto:alipey at gmail.com" ta=
rget=3D"_blank">alipey at gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Thank you Bogdan. That answers all my questi=
ons.<div><br></div><div>Regards,</div><div>Ali Pey</div><div>
<div><div><br><br><div class=3D"gmail_quote">On Wed, Aug 29, 2012 at 12:37 =
PM, Bogdan-Andrei Iancu <span dir=3D"ltr">&lt;<a href=3D"mailto:bogdan at open=
sips.org" target=3D"_blank">bogdan at opensips.org</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><u></u>

 =20
   =20
 =20
  <div bgcolor=3D"#ffffff" text=3D"#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=3D"72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href=3D"http://www.opensips-solutions.com" target=3D"_blank">http://www.=
opensips-solutions.com</a></pre><div><div>
    <br>
    On 08/29/2012 07:35 PM, Ali Pey wrote:
    <blockquote type=3D"cite">Hi Jeff,
      <div><br>
      </div>
      <div>Thank you for the reply but unfortunately this doesn&#39;t answe=
r
        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=3D"gmail_quote">On Wed, Aug 29, 2012 at 12:27 PM, Jeff
          Pyle <span dir=3D"ltr">&lt;<a href=3D"mailto:jpyle at fidelityvoice.=
com" target=3D"_blank">jpyle at fidelityvoice.com</a>&gt;</span>
          wrote:<br>
          <blockquote class=3D"gmail_quote" style=3D"margin:0pt 0pt 0pt 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div>Ali,</div>
            <div><br>
            </div>
            <div>Oops, I had some inconsistent rewrites. =A0So much for
              improved readability. =A0Consider this instead:</div>
            <div><br>
            </div>
            <div>
              <div><font face=3D"courier new, monospace" size=3D"1">=A0 =A0=
 =A0 =A0
                  # Check to see if we&#39;re at maximum capacity for this
                  gateway</font></div>
              <div>
                <div><font face=3D"courier new, monospace" size=3D"1">=A0 =
=A0 =A0
                    =A0 if !(get_profile_size(&quot;outbound&quot;,
                    &quot;$avp(s:dlgid_out)&quot;, &quot;$var(dlgsize_out)&=
quot;)) {</font></div>
                <div><font face=3D"courier new, monospace" size=3D"1">=A0 =
=A0 =A0
                    =A0 =A0 =A0 =A0 =A0 xlog(&quot;L_INFO&quot;, &quot;Coul=
dn&#39;t get dialog size,
                    continuing route-out\n&quot;);</font></div>
                <div><font face=3D"courier new, monospace" size=3D"1">=A0 =
=A0 =A0
                    =A0 } else {</font></div>
              </div>
              <div><font face=3D"courier new, monospace" size=3D"1">=A0 =A0=
 =A0 =A0
                  =A0 =A0 =A0 =A0 if (is_avp_set(&quot;$avp(s:gw_maxcalls)&=
quot;)
                  &amp;&amp; $var(dlgsize_out) &gt;=3D
                  $avp(s:gw_maxcalls)) {</font></div>
              <div><font face=3D"courier new, monospace" size=3D"1">=A0 =A0=
 =A0 =A0
                  =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # We&#39;re full, so cycl=
e around to the
                  next gateway...</font></div>
              <div><font face=3D"courier new, monospace" size=3D"1">=A0 =A0=
 =A0 =A0
                  =A0 =A0 =A0 =A0 }</font></div>
              <div><font face=3D"courier new, monospace" size=3D"1">=A0 =A0=
 =A0 =A0
                  }</font></div>
            </div>
            <div><br>
            </div>
            <div>That should make more sense.</div>
            <span><font color=3D"#888888">
                <div><br>
                </div>
                <div><br>
                </div>
                <div>- Jeff</div>
              </font></span>
            <div>
              <div>
                <div><br>
                </div>
                <br>
                <br>
                <br>
                <div class=3D"gmail_quote">On Wed, Aug 29, 2012 at 12:24
                  PM, Jeff Pyle <span dir=3D"ltr">&lt;<a href=3D"mailto:jpy=
le at fidelityvoice.com" target=3D"_blank">jpyle at fidelityvoice.com</a>&gt;</sp=
an>
                  wrote:<br>
                  <blockquote class=3D"gmail_quote" style=3D"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. =A0A little before
                      the <font face=3D"courier new, monospace">t_relay()</=
font>
                      to the gateway, I have:</div>
                    <div>
                      <div><br>
                      </div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 # Check to see if we&#39;re at maximu=
m
                          capacity</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 if !(get_profile_size(&quot;outbound&=
quot;,
                          &quot;$avp(s:dlgid_out)&quot;, &quot;$var(dlgsize=
_out)&quot;)) {</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 =A0 =A0 =A0 =A0 xlog(&quot;L_INFO&quo=
t;, &quot;Couldn&#39;t get
                          dialog size, continuing route-out\n&quot;);</font=
></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 } else {</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 =A0 =A0 =A0 =A0 if
                          (is_avp_set(&quot;$avp(s:gw_maxcalls)&quot;) &amp=
;&amp;
                          $var(dlgsize_out) &gt;=3D $avp(s:car_maxcalls))
                          {</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Mov=
e on to the next
                          carrier...</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</font=
></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 =A0 =A0 =A0 =A0 }</font></div>
                      <div><font face=3D"courier new, monospace" size=3D"1"=
>=A0
                          =A0 =A0 =A0 }</font></div>
                    </div>
                    <div><font face=3D"courier new, monospace" size=3D"1">=
=A0
                        =A0 =A0 =A0 # Continue towards t_relay() for this
                        gateway...</font></div>
                    <div><br>
                    </div>
                    <div>This verifies our counts to make sure we have
                      room. =A0If I&#39;m at that value (or over) I cycle
                      around and select the next gateway. =A0If all is
                      well I=A0run=A0<font face=3D"courier new, monospace">=
set_dlg_profile(&quot;outbound&quot;,
                        &quot;</font><span>$avp(s:dlgid_out)</span><font fa=
ce=3D"courier new, monospace">&quot;)</font>. =A0Since
                      you&#39;re using drouting, perhaps you&#39;ll use ano=
ther
                      variable here in place of=A0<span style=3D"font-famil=
y:&#39;courier new&#39;,monospace">$avp(s:dlgid_out)</span>.</div>
                    <div><br>
                    </div>
                    <div>I implement serial forking for my gateways. =A0In
                      the selected failure_route I run=A0<font face=3D"cour=
ier new, monospace">unset_dlg_profile(&quot;outbound&quot;,
                        &quot;$avp(s:dlgid_out)&quot;)</font>. =A0If 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=3D"gmail_quote">
                      <div>
                        <div>On Wed, Aug 29, 2012 at 11:53 AM, Ali Pey <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:alipey at gmail.com" target=3D"_blank">ali=
pey at gmail.com</a>&gt;</span>
                          wrote:<br>
                        </div>
                      </div>
                      <blockquote class=3D"gmail_quote" style=3D"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=3D"http://www.opens=
ips.org/Resources/DocsTutConcurrentCalls" target=3D"_blank">http://www.open=
sips.org/Resources/DocsTutConcurrentCalls</a>)
                              and this is not the same.=A0</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=A0set_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=A0get_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=3D"mailto:Users at lists.opensips.org" target=
=3D"_blank">Users at lists.opensips.org</a><br>
                        <a href=3D"http://lists.opensips.org/cgi-bin/mailma=
n/listinfo/users" target=3D"_blank">http://lists.opensips.org/cgi-bin/mailm=
an/listinfo/users</a><br>
                        <br>
                      </blockquote>
                    </div>
                    <br>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a href=3D"mailto:Users at lists.opensips.org" target=3D"_blank">U=
sers at lists.opensips.org</a><br>
            <a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/u=
sers" target=3D"_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=3D"mailto:Users at lists.opensips.org" target=3D"_blank">Users at lists.o=
pensips.org</a>
<a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=
=3D"_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </div></div></div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href=3D"mailto:Users at lists.opensips.org" target=3D"_blank">Users at lists.o=
pensips.org</a><br>
<a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=
=3D"_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=3D"mailto:Users at lists.opensips.org" target=3D"_blank">Users at lists.o=
pensips.org</a><br>
<a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=
=3D"_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br=
>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href=3D"mailto:Users at lists.opensips.org">Users at lists.opensips.org</a><br=
>
<a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=
=3D"_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br=
>
<br></blockquote></div><br></div>

--f46d04016a673bfcc704c86ae370--



More information about the Users mailing list