Hi Shaahin,

Why not simply using the Dynamic Routing module :
        http://www.opensips.org/html/docs/modules/1.8.x/drouting.html

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 08/30/2012 03:07 PM, Shaahin Madani wrote:

Greetings,


In my OpenSIPS server, when I receive an INVITE requests, I need to (1) consult an external database to get a list of gateways, and (2) send the request to those gateways, in order, starting from the first and trying the next only if the current one fails (e.g. irresponsive, offline, busy, etc).


I understand that forwarding calls to a certain gateway can be achieved using the rewritehostport(…)function; and that prefix-/caller-/group-/time-/priority-based dynamic routing can be addressed using the DROUTINGmodule. However, in my system what actually is “dynamic” is the gateway list itself, which is therefore not a subset of the dr_gatewaystable. In fact, OpenSIPS has no idea about the list of gateways due to the complex business-logic involved. The dynamic gateway list, nevertheless, needs to be treated identical to an ordinary one, i.e. prefix, time and priority of gateways must be considered.


Solving this problem, I assume, requires either writing a whole new DROUTINGmodule, which wraps the necessary business-logic and consults the external database; or wrapping the business-logic in a Perl script that is called from the routing script (opensips.cfg). Now, there are two issues that I would like to know your expert opinion about:


1. Is my solution, i.e. using the Perl script to wrap the business logic and queries to the external database, the best possible way to do this?


2. As the list of gateways is dynamic, is there any way to leverage the facilities offered by the DROUTINGmodule? Specifically, can I somehow get the list of gateways from the Perl script and pass it to the DROUTINGmodule for prefix-/time-/priority-based routing, or probing, purposes?


Regards,

Shaahin Madani


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to