[OpenSIPS-Users] Building an Opensips cluster with presence - help needed

James Lamanna jlamanna at gmail.com
Fri Aug 5 19:28:55 CEST 2011


Hi Anca, Bogdan, and list,

I've been banging my head against this for some time now, so I'm
wondering what I'm trying to do is possible.
My goal is to create an Opensips cluster that provides the following:

1) Registration for phones behind NAT
2) BLF/Presence information (through Event: dialog)

All of the actual dialplan/PSTN stuff will be managed by a cluster of
Asterisk boxes upstream.

The idea is that the servers are all listed in a single DNS A record,
and a phone can register to any opensips box at any time and still
have all functionality.

I'm not using a shared DB approach for a couple of reasons:

1) I'm trying to get rid of single points of failure.
2) Because all the phones are behind NAT, all packets to the phone
must be sent from the server that it registered on.

I've managed to get all the registration and call handling working
fine using t_replicate() on REGISTER requests;
Inbound and outbound calls work great!

The biggest issue I've run into is getting the BLF/Presence
information to propagate properly.

My first thought was to have each server keep SUBSCRIBEs locally, but
distribute PUBLISH messages from the presence module.
Unfortunately this did not work due to failed E-Tag matching.
   - As far as I understand, the E-Tag is server specific and must
match something in the presentity table?
   - Distributing a PUBLISH generated by 1 server to another server
always resulted in a "E-Tag, no match found" error

My second idea was to distribute SUBSCRIBEs, and keep PUBLISH local.
This worked great for the first SUBSCRIBE from a phone.
However, any renewing of the subscription caused distributed
SUBSCRIBEs to fail because each server generates its own to_tag,
which, when forwarding the next SUBSCRIBE that has server1's to_tag,
would fail to match any other server because they already
had a subscription with a different to_tag.

My question is, is there a way to solve this? Am I going about this
completely the wrong way?
Is this an insane idea that will never work?

I've kinda hit a wall here, so any help would be appreciated.

Thanks.

-- James



More information about the Users mailing list