[OpenSER-Devel] [ openser-Bugs-1790628 ] [presence] "server_address" parameter is a limitation

SourceForge.net noreply at sourceforge.net
Mon Sep 10 14:47:13 CEST 2007


Bugs item #1790628, was opened at 2007-09-08 14:36
Message generated for change (Comment added) made by miconda
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1790628&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Closed
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
Assigned to: Daniel-Constantin Mierla (miconda)
Summary: [presence] "server_address" parameter is a limitation

Initial Comment:
I've a multidomain OpenSer with a table in which I decide with type of SIP messages can be routed from one local or external domain to each local domain (based on message URI).

With this I can implement permissions system inter-domain, and a system similar to XCAP but in server side (with no client requeriments). The client can send a SUBSCRIBE for other domain and OpenSer allows or denies it based on the table content.

But unfortunatelly all my system is "canceled" by the "server_address" parameter:
http://www.openser.org/docs/modules/1.2.x/presence.html#AEN190

This parameter forces OpenSer to send a "Contact" header in 200-OK, so following SUBSCRIBE messages from clients will go to that URI instead of the URI of the "To" header of the SUBSCRIBE message.

Because of it, a initial "SUBSCRIBE" is allowed because I allow SUBSCRIBE from "domain1.com" to "domain2.org":
  
  SUBSCRIBE sip:user at domain2.org
  From: sip:me at domain1.com
  To:   sip:user at domain2.org

But in the 200 OK I get a "Contact: sip:server_IP:5060" so the following SUBSCRIBE refresh is:

  SUBSCRIBE sip:server_IP:5060
  From: sip:me at domain1.com
  To:   sip:user at domain2.org

But this message is denied by my OpenSer because I don't allow it. If I allow it then I just can't deny any SUBSCRIBE inter-domain, so my aim is lost.


So I ask: couldn't be possible not to include that "Contact" header in the 200 OK? Maybe it would be RFC not compliant?

Regards.

----------------------------------------------------------------------

>Comment By: Daniel-Constantin Mierla (miconda)
Date: 2007-09-10 15:47

Message:
Logged In: YES 
user_id=1246013
Originator: NO

The your sip device (phone) is broken, ask the vendor to fix it. Should
not send an out-of-dialog request to the contact address in a previous
200ok. Either sends the subscribe in same dialog, using the contact, route
set and appropriate To tag, or makes a new dialog, by putting the right
domain of the destination user.


----------------------------------------------------------------------

Comment By: Iñaki Baz (ibc_sf)
Date: 2007-09-10 15:34

Message:
Logged In: YES 
user_id=1844020
Originator: YES

Yes, I apply that filter only to not-in-dialog SUBSCRIBE (does exist
SUBSCRIBE in-dialog?).

My problem is:

- Imagine "server_address" for presence module is:   sip:mydomain.org
- My SIP client sends a SUBSCRIBE for presence of an user:
 
    SUBSCRIBE sip:userX at otherdomain.com
    To: sip:userX at otherdomain.com

- So it receives a "200 OK" with Contact: sip.mydomain.org.
- After 500 seconds (or whatever configured in SIP client for subscribe 
  refresh) my SIP client sends again a SUBSCRIBE for each buddy. This
SUBSCRIBE 
  is **NOT in-dialog** (of course), but it goes to URI of "200 OK"
"Contact" header:

    SUBSCRIBE sip:mydomain.org
    To: sip:userX at otherdomain.com

- So there is my problem, because I can't match the SUBSCRIBE URI against
my permissions table since now the URI is not the URI of "To" header.

For that, what I do is detect SUBSCRIBES to "sip:mydomain.org" and changes
the URI with the "To" before my permissions table.


----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2007-09-10 13:06

Message:
Logged In: YES 
user_id=1246013
Originator: NO

Your filter is not applied very correct for what you want to do. The
server has to set a contact address in 200ok, to establish the dialog of
SUBSCRIBE. If the phone sends another SUBSCRIBE in the same dialog, it has
to populate the To tag and use the contact address in r-uri. Such messages
should not be denied, but should be sent to/handled by presence server.

The presence server will reject any SUBSCRIBE with To tag that does not
correspond to an existing dialog. So, the solution is to apply the filter
only for SUBSCRIBE messages without To tag.

----------------------------------------------------------------------

Comment By: Iñaki Baz (ibc_sf)
Date: 2007-09-10 11:50

Message:
Logged In: YES 
user_id=1844020
Originator: YES

Thanks a lot for the explanation. Let me just a question to be sure:

So, in the trunk version if I don't set the "server_address" parameter and
receive a SUBSCRIBE like:

  SUBSCRIBE sip:user at domain2.org
  From: sip:me at domain1.com
  To: sip:user at domain2.org

Then do you mean that the generated "Contact" will be "sip:domain2.org"?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-10 11:32

Message:
Logged In: NO 


I have not paid attention that you are using 1.2.x branch. The improvement
has been made in the trunk only.


----------------------------------------------------------------------

Comment By: Iñaki Baz (ibc_sf)
Date: 2007-09-10 11:27

Message:
Logged In: YES 
user_id=1844020
Originator: YES

Hi, you say that 'server address' parameter is not compulsory, but if I
not set it I can't start OpenSer because an error:

  0(0) PRESENCE:mod_init:ERROR server_address parameter has no value
  0(0) init_mod(): Error while initializing module presence
  ERROR: error while initializing modules

So? isn't it compulsory?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-10 11:05

Message:
Logged In: NO 

Hello Iñaki,

The 'server address' parameter is not compulsory. If not set, the address
to be inserted in Contact header for replies and Notify messages is taken
from the Subscribe receive info for the destination: ip addr, port and
protocol.

regards, 

Anca Vamanu

----------------------------------------------------------------------

Comment By: Iñaki Baz (ibc_sf)
Date: 2007-09-08 22:36

Message:
Logged In: YES 
user_id=1844020
Originator: YES

I've found a solution for my problem:

  modparam("presence","server_address","sip:just_presence.domain.org")

So when OpenSer receives a SUBSCRIBE with URI
"sip:just_presence.domain.org" then I rewrite URI:

  $ru = $tu;

And after that my permissions table (based in URI) is readed to allow or
deny the SUBSCRIBE.


Anyway, a easier solution would be not to include a "Contact" header in
the "200 OK" to "SUBSCRIBE/PUBLISH" or "NOTIFY" messages from OpenSer's
"presence" module. The only issue could be if that "Contact" is RFC
requeriment for those type of messages, so I'll investigate it.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1790628&group_id=139143



More information about the Devel mailing list