[OpenSIPS-Users] A Dynamic List of Gateways

Shaahin Madani shaahin.madani at gmail.com
Thu Aug 30 14:07:56 CEST 2012


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 DROUTING module. However, in my system what actually is
“dynamic” is the gateway list itself, which is therefore not a subset of
the dr_gateways table. 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 DROUTING module? 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120830/d794e9a6/attachment.htm>


More information about the Users mailing list