[Freeswitch-dev] Hundreds of filters with mod_event_socket
Juan Jose Comellas
juanjo at comellas.org
Wed Sep 15 14:15:44 PDT 2010
I am using mod_event_socket in inbound mode to receive events and send
actions to FreeSWITCH and mod_xml_curl to return dialplans over HTTP. I have
multiple FS servers and multiple servers running my application. Currently I
have a 1-to-1 mapping between each FS server and a server hosting my
application. I want to remove the 1-to-1 mapping and have my application on
one server take over the mod_event_socket connection to FS in another server
if the application crashes.
The plan is to have multiple app instances connected to multiple FS
instances where every instance of my app would be connected to every FS
server in its group. In order to do this, it looks like I would have to use
filters to avoid receiving the events for all the channels on all my app
instances all the time. So, when starting the mod _event_socket connection
I'd have to do something like this on all my app instances:
events plain all
filter Event-Name CHANNEL_CREATE
And then when a channel is created and all my app instances receive the
CHANNEL_CREATE event, have one of them "win" and assign the channel to it.
That instance will then issue the following action over mod_event_socket:
filter Unique-ID <channel_id>
The problem I see with this scheme is that I would probably end up with
hundreds of filters per mod_event_socket connection. From what I've seen in
the code, the filters are kept as a linked-list. This means that for each
event fired, a list of hundreds of elements will have to be evaluated every
time, which is obviously undesirable.
Does anybody know of a better way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the FreeSWITCH-dev