[OpenSIPS-Users] Question about mediaproxy relay preference

Saúl Ibarra Corretgé saul at ag-projects.com
Wed Apr 7 09:45:09 CEST 2010


Hi,

On 5/4/10 10:13 PM, Henk Hesselink wrote:
> Hi Adrian,
>
> The way I read the code I can indicate one preferred relay, but not a
> set.  So I can't say "prefer this set of relays (i.e. the ones in this
> particular datacenter) over the rest".  That's less flexible than the
> SRV style.
>
> What would be great would be a dispatcher option to say "based on the
> media streams in the SDP, prefer 'local' relays" for some definition of
> local - for instance relays that are on the same subnet as one or more
> of the media endpoints.  I might be able to code up a patch for that if
> you can give me a hint where to start (looks like that would be the
> send_command method in the RelayFactory class).
>

Currently only a single preferred relay can be used. The send_command 
method from the RelayFactory class is responsible for selecting the 
relay which will be used, currently in a random way if no preferred 
relay is specified.

The preferred relay is specified from the OpenSIPS configuration file 
through an AVP and the mediaproxy module sends this information to the 
dispatcher through the 'update' command. So that function would also 
need modifications.

Now the tricky part would be to decide where to do the actual DNS lookup.

   - If the lookup is done in OpenSIPS, you could pass a space separated 
list of relays (in the right order) which would be appended at the 
beginning of the list.

   - Do the lookup in MediaProxy.

I'd rather not do it on MediaProxy, as this would increase the 
complexity and add delay (due to the DNS lookup) to the setup of the call.

Having that said, here is my proposal: modify both OpenSIPS module and 
MdediaProxy to accept a list of space separated relays. The way of 
building that list should be decoupled from the whole process IMHO, so 
you could do it by having the DNS query results cached somewhere. This 
would prevent the delay that DNS query may cause.



Regards,

-- 
Saúl Ibarra Corretgé
AG Projects



More information about the Users mailing list