<div dir="ltr"><div><font><font face="verdana,sans-serif">Hi Sammy,</font></font></div><div><font><font face="verdana,sans-serif"><br></font></font></div><div><font face="verdana, sans-serif">It made perfect sense, and is actually very close to my requirement. Thanks for sharing your experience. Please find my replies below.</font></div>
<font><div style="font-family:verdana,sans-serif"><font><font face="verdana,sans-serif"><br></font></font></div><div><div><font face="arial, helvetica, sans-serif" color="#006600">> I see what you are trying to do here, get a list of gateways to be used for a particular destination(or any other logic) </font></div>
<div><font face="arial, helvetica, sans-serif" color="#006600">> and then based on that list involve the drouting module. What I can imagine here is this would result in something </font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> like inserting the returned list into opensips first and then asking the module(insert into module table, refresh the </font></div>
<div><font face="arial, helvetica, sans-serif" color="#006600">> module list and then) to do the processing for you.</font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> If you have something like above in your mind, then it will be a performance overhead on per call basis !</font></div>
</div><div style="font-family:verdana,sans-serif"><font><font face="verdana,sans-serif"><br></font></font></div><div><font><font face="verdana,sans-serif" style="font-family:verdana,sans-serif">That is exactly what I had in mind, with only a small difference. I was hoping to find a way to let the </font><font face="courier new, monospace">drouting</font><font face="verdana,sans-serif" style="font-family:verdana,sans-serif"> module know about the gateway list without going through the database channel, i.e. inserting the gateway list into database with every call. If I could do that, it would reduce the performance overhead by avoiding unnecessary queries for reloading data into </font><font face="courier new, monospace">drouting </font><font face="verdana,sans-serif" style="font-family:verdana,sans-serif">module.</font></font></div>
<div style="font-family:verdana,sans-serif"><font><font face="verdana,sans-serif"><br></font></font></div><div style="font-family:verdana,sans-serif"><font><font face="verdana,sans-serif"><br></font></font></div><div><div style="font-family:arial">
<font color="#006600">> I'd suggest you to go without the Drouting module, in your perl script do all the gateway processing and send back </font></div><div style="font-family:arial"><font color="#006600">> results to opensips in AVPs and develop the "Drouting like" functionality in opensips.</font></div>
<div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">I am implementing it like this now. One feature that I believe I cannot implement with the combination of script+Perl is monitoring the status of gateway using SIP probing. I need this feature, and the only way I can imagine it can be activated is to let the</font><font face="verdana, sans-serif"> </font><font face="courier new, monospace">drouting</font><font face="verdana, sans-serif"> module have the list of all gateways (say by direct access to the external database), but then the </font><font face="courier new, monospace">drouting</font><font face="verdana, sans-serif"> module would want to load the whole database entries into memory all the time - but, before jumping to conclusion, I'd better test and see the memory penalty. </font></div>
</div><div><font><font face="verdana,sans-serif"><br></font></font></div><div style="font-family:verdana,sans-serif"><font><font face="verdana, sans-serif"><br></font></font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> Though I'm not sure about your whole scenario precisely, what I can tell you is how I had done somewhat similar </font></div>
<div><font face="arial, helvetica, sans-serif" color="#006600">> setup. I had all the gateways in a different DB and was using OpenSIPS-RADIUS integration. RADIUS used perl </font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> scripts and returned a list of sorted gateways to try. The list was processed in opensips in serial-forking manner.</font>
</div><div style="font-family:verdana,sans-serif"><span style="font-family:arial"><br></span></div><font face="verdana, sans-serif">Did you have the requirement for probing too?</font></font><div><font><font face="verdana, sans-serif"><br>
</font></font></div><div><font><font face="verdana, sans-serif"><br></font></font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> Another possibility, that I can think for you, is tell your Drouting module to connect to the DB containing the table </font></div>
<div><font face="arial, helvetica, sans-serif" color="#006600">> with ALL the gateways in it. The perl script will just return you the prefixes or enough logic to be input to the DROUTING </font></div><div><font face="arial, helvetica, sans-serif" color="#006600">> functions and Drouting decides the actual gateway. (Make sure in your perl script you put intelligent logic which will </font></div>
<div><font face="arial, helvetica, sans-serif" color="#006600">> ensure that DROUTING module selects from only your desired gateways)</font>
</div><div><font><font face="verdana, sans-serif"><br></font></font></div><div><font><font face="verdana, sans-serif">Thanks for pointing this out. I need to feed a strict list into the </font><font face="courier new, monospace">drouting</font><font face="verdana, sans-serif"> module; and the only somewhat related parameter I found is the </font><font face="courier new, monospace">gw_whitelist</font><font face="verdana, sans-serif"> of the </font><font face="courier new, monospace">do_routing(...)</font><font face="verdana, sans-serif"> function, which seems to be able to do the job if I can fill it with a </font></font><font><font face="verdana, sans-serif">list </font></font><span style="font-family:verdana,sans-serif">of gateway ID or IP values (the </span><a href="http://www.opensips.org/html/docs/modules/devel/drouting.html#id293431" style="font-family:verdana,sans-serif">documentation</a><span style="font-family:verdana,sans-serif"> doesn't clearly say what is expected in that parameter). </span></div>
<div><span style="font-family:verdana,sans-serif"><br></span></div><div><span style="font-family:verdana,sans-serif">Kind regards,</span></div><div><span style="font-family:verdana,sans-serif">Shaahin Madani</span></div><div>
<font><font face="verdana, sans-serif"><br></font></font></div><div><font><font face="verdana, sans-serif"><br></font></font></div><div><font><font face="verdana, sans-serif"><br></font></font><br><div class="gmail_quote">
On Fri, Aug 31, 2012 at 4:28 PM, SamyGo <span dir="ltr"><<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Shaahin,<div><br></div><div>I see what you are trying to do here, get a list of gateways to be used for a particular destination(or any other logic) and then based on that list involve the drouting module. What I can imagine here is this would result in something like inserting the returned list into opensips first and then asking the module(insert into module table, refresh the module list and then) to do the processing for you.</div>
<div><br></div><div>If you have something like above in your mind, then it will be a performance overhead on per call basis !</div><div><br></div><div>I'd suggest you to go without the Drouting module, in your perl script do all the gateway processing and send back results to opensips in AVPs and develop the "Drouting like" functionality in opensips.</div>
<div><br></div><div>Though I'm not sure about your whole scenario precisely, what I can tell you is how I had done somewhat similar setup. I had all the gateways in a different DB and was using OpenSIPS-RADIUS integration. RADIUS used perl scripts and returned a list of sorted gateways to try. The list was processed in opensips in serial-forking manner.</div>
<div><br></div><div>Another possibility, that I can think for you, is tell your Drouting module to connect to the DB containing the table with ALL the gateways in it. The perl script will just return you the prefixes or enough logic to be input to the DROUTING functions and Drouting decides the actual gateway. (Make sure in your perl script you put intelligent logic which will ensure that DROUTING module selects from only your desired gateways)</div>
<div><br></div><div>I hope I made some sense here.</div><div><br></div><div>Regards,</div><div>Sammy</div><div class="HOEnZb"><div class="h5"><div><br></div><div><br><div class="gmail_quote">On Fri, Aug 31, 2012 at 7:55 AM, Shaahin Madani <span dir="ltr"><<a href="mailto:shaahin.madani@gmail.com" target="_blank">shaahin.madani@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font><font face="verdana,sans-serif">Greetings,</font></font><div><font><font face="verdana,sans-serif"><br>
</font></font></div><div><font><font face="verdana,sans-serif">Thanks for the helpful replies. Presently, the list of gateways cannot be retrieved using a direct query on the external database, and hence I need the Perl script to act as the middle-ware too. Some changes in the external database may fix this, and then I would be able to use the </font></font><font face="courier new, monospace">avops</font><font face="verdana, sans-serif"> module as Ali suggested, </font><span style="font-family:verdana,sans-serif">but I need to first thoroughly study all the consequences ...</span></div>
<div><font><font face="verdana,sans-serif"><br></font></font></div><div><font><font face="verdana,sans-serif">Regarding the bottleneck issue, I don't see any way that I can avoid the queries (or Perl). In case it turns out to be a real bottleneck, then is there any way to go around it, or will I actually be hitting an OpenSIPS limitation?</font></font></div>
<div><font><font face="verdana,sans-serif"><br></font></font></div><div><font><font face="verdana,sans-serif">Cheers,</font></font></div><div><font><font face="verdana,sans-serif">Shaahin</font></font></div><div><font><font face="verdana,sans-serif"><br>
</font></font></div><div><font face="verdana, sans-serif">P.S. [to Ali and Rudy]: It's "Shaahin", not "Shaheen" :-)</font></div><div><div><div><font><font face="verdana,sans-serif"><br>
</font></font></div><div>
<font><font face="verdana,sans-serif"><br></font></font><br><div class="gmail_quote">On Fri, Aug 31, 2012 at 2:03 AM, Rudy <span dir="ltr"><<a href="mailto:rudy@dynamicpacket.com" target="_blank">rudy@dynamicpacket.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Brett,<br>
<br>
Any complex logic, perl, sql or otherwise can impact performance and<br>
create a bottleneck. Regarding the perl module in particular, I can<br>
tell you that it works pretty well.<br>
<br>
Thanks in advance,<br>
<div>--Rudy<br>
Dynamic Packet<br>
Toll-Free: 888.929.VOIP ( 8647 )<br>
<br>
<br>
</div><div><div>On Thu, Aug 30, 2012 at 11:58 AM, Brett Nemeroff <<a href="mailto:brett@nemeroff.com" target="_blank">brett@nemeroff.com</a>> wrote:<br>
> If you can sum up the logic in an SQL query I'd recommend doing that. If you<br>
> can cache the results in memcache, even better. Just keep in mind that any<br>
> complicated logic can serve as a significant bottleneck. Depending on your<br>
> traffic load, that may or may not be an issue.<br>
><br>
> I know there are a few recommendations for the perl module here, but I'm not<br>
> sure of the status of the module and if it's actively maintained. I'd love<br>
> to hear from others about their own experiences using it. I haven't used it<br>
> myself in maybe 6 years or so.<br>
> -Brett<br>
><br>
><br>
> On Thu, Aug 30, 2012 at 9:09 AM, Shaahin Madani <<a href="mailto:shaahin.madani@gmail.com" target="_blank">shaahin.madani@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Bogdan and Brett,<br>
>><br>
>> Thanks for your replies. The issue here is that my OpenSIPS simply does<br>
>> not have the list of gateways, that is the gateways are *not* available in<br>
>> the dr_gateways table. For every INVITE request, the list of gateways must<br>
>> be dynamically built, and only afterwards the actual dynamic routing can<br>
>> take place. The logic behind building the list of gateways relies on a<br>
>> totally separate database.<br>
>> To sum it up, I would say the desired scenario would resemble the steps<br>
>> below:<br>
>><br>
>> 1) OpenSIPS receives an INVITE<br>
>> 2) OpenSIPS asks an external system (e.g. the Perl script) for the<br>
>> gateways available for this specific INVITE request<br>
>> 3) A list of gateways is returned to OpenSIPS (based on some black-box<br>
>> logic)<br>
>> 4) OpenSIPS dynamically routes the INVITE to the specified gateways,<br>
>> prioritising based on cost, time, or ...<br>
>><br>
><br>
</div></div><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>
<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>
</div></div></blockquote></div><br></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></div>