Re: [Sofia-sip-devel] REGISTER Refreshing Error?

2009-07-31 Thread Jim Thomas
Hello Jerry,

It looks like you and I have run into the same issue.  Please see my recent 
post 'Registration issue with SIP server behind SBC'.

I think Sofia-SIP is doing the right thing.  From RFC 3261:

  The 200 (OK) response from the registrar contains a list of Contact
  fields enumerating all current bindings.  The UA compares each
  contact address to see if it created the contact address, using
  comparison rules in Section 19.1.4.  If so, it updates the expiration
  time interval according to the expires parameter or, if absent, the
  Expires field value.  The UA then issues a REGISTER request for each
  of its bindings before the expiration interval has elapsed.  It MAY
  combine several updates into one REGISTER request.

That sounds like the SIP designers intended for the original Contact header to 
be preserved in the response as a correlation hook.

However, we still need a way to integrate with systems that perhaps improperly 
modify the Contact header.

Since controlling the behavior of the far end system is typically beyond our 
control, one approach might be for Sofia-SIP to use the value in the Expires 
header in the 200 OK response if the Contact header has been changed such that 
it no longer correlates and the 'expires' parameter in that header will not be 
used.

My reading of the RFC 3261 excerpt above seems like maybe this is the intended 
behavior of the SIP stack anyway.

I haven't reviewed the Sofia-SIP source, but in my case, the 200 OK response 
with the modified Contact header *does* also include a separate Expires header, 
and the value in that Expires header is not being used by Sofia-SIP as a 
fall-back registration fallback, so I assume Sofia-SIP is not using that as a 
fall-back when the Contact header URIs do not correlate.

I would be interested to learn what solution you or the Sofia-SIP maintainers 
come up with.

Thanks.

Jim



- Original Message 
From: Jerry Richards 
To: sofia-sip-devel@lists.sourceforge.net
Sent: Thursday, July 30, 2009 5:39:22 PM
Subject: Re: [Sofia-sip-devel] REGISTER Refreshing Error?

Okay, I found the code that is causing sofia-sip to use the default Expires
value instead of the value specified by the server.  It is in the
nua_register_client_response() function in the
libsofia-sip-ua/nua/nua_register.c file.

It appears a for-loop check in this function is comparing the sent Contact
URL to the received Contact URL which is always different (because the sent
URL is the phone's URL and the received URL is the server's URL), thus the
code that sets the refresh time to the received Expires value is never
getting invoked.

Jerry


-Original Message-
From: Jerry Richards [mailto:jer...@tonecommander.com] 
Sent: Monday, July 27, 2009 11:04 AM
To: 'sofia-sip-devel@lists.sourceforge.net'
Subject: REGISTER Refreshing Error?

Hello,

I am using version 1.12.9 and noticed the sofia-sip stack setting the
register refresh timer to the wrong value.  That is, the 200 OK includes
"Expires: 60", but sofia-sip logs this:

"nua(): refresh register after 1905 seconds (in [900..2700])".

Here is the 200 OK content:

Status-Line: SIP/2.0 200 OK
Message Header:
  To: ...
  From: ...
  Call-ID: ...
  Via: ...
  User-Agent: ...
  Max-Forwards: ...
  Contact: sip:6...@192.168.72.128:5060
  Cseq: 118227582 REGISTER
  Expires: 60
  Content-Length: 0

Do you know why the timer could be wrong?  It looks like it's getting set to
the default 3600 seconds.

Best Regards,
Jerry


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel



  


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] REGISTER Refreshing Error?

2009-07-31 Thread Inca Rose
Hi;
The Contact in the OK response is missing the expires parameter.
Each contact in the OK response to a REGISTER request must carry an  
expires parameter, this expires is added
by the Registrar server.

Regards
Inca

On Jul 31, 2009, at 5:05 PM, Jim Thomas wrote:

> Hello Jerry,
>
> It looks like you and I have run into the same issue.  Please see my  
> recent post 'Registration issue with SIP server behind SBC'.
>
> I think Sofia-SIP is doing the right thing.  From RFC 3261:
>
>   The 200 (OK) response from the registrar contains a list of Contact
>   fields enumerating all current bindings.  The UA compares each
>   contact address to see if it created the contact address, using
>   comparison rules in Section 19.1.4.  If so, it updates the  
> expiration
>   time interval according to the expires parameter or, if absent, the
>   Expires field value.  The UA then issues a REGISTER request for each
>   of its bindings before the expiration interval has elapsed.  It MAY
>   combine several updates into one REGISTER request.
>
> That sounds like the SIP designers intended for the original Contact  
> header to be preserved in the response as a correlation hook.
>
> However, we still need a way to integrate with systems that perhaps  
> improperly modify the Contact header.
>
> Since controlling the behavior of the far end system is typically  
> beyond our control, one approach might be for Sofia-SIP to use the  
> value in the Expires header in the 200 OK response if the Contact  
> header has been changed such that it no longer correlates and the  
> 'expires' parameter in that header will not be used.
>
> My reading of the RFC 3261 excerpt above seems like maybe this is  
> the intended behavior of the SIP stack anyway.
>
> I haven't reviewed the Sofia-SIP source, but in my case, the 200 OK  
> response with the modified Contact header *does* also include a  
> separate Expires header, and the value in that Expires header is not  
> being used by Sofia-SIP as a fall-back registration fallback, so I  
> assume Sofia-SIP is not using that as a fall-back when the Contact  
> header URIs do not correlate.
>
> I would be interested to learn what solution you or the Sofia-SIP  
> maintainers come up with.
>
> Thanks.
>
> Jim
>
>
>
> - Original Message 
> From: Jerry Richards 
> To: sofia-sip-devel@lists.sourceforge.net
> Sent: Thursday, July 30, 2009 5:39:22 PM
> Subject: Re: [Sofia-sip-devel] REGISTER Refreshing Error?
>
> Okay, I found the code that is causing sofia-sip to use the default  
> Expires
> value instead of the value specified by the server.  It is in the
> nua_register_client_response() function in the
> libsofia-sip-ua/nua/nua_register.c file.
>
> It appears a for-loop check in this function is comparing the sent  
> Contact
> URL to the received Contact URL which is always different (because  
> the sent
> URL is the phone's URL and the received URL is the server's URL),  
> thus the
> code that sets the refresh time to the received Expires value is never
> getting invoked.
>
> Jerry
>
>
> -Original Message-
> From: Jerry Richards [mailto:jer...@tonecommander.com]
> Sent: Monday, July 27, 2009 11:04 AM
> To: 'sofia-sip-devel@lists.sourceforge.net'
> Subject: REGISTER Refreshing Error?
>
> Hello,
>
> I am using version 1.12.9 and noticed the sofia-sip stack setting the
> register refresh timer to the wrong value.  That is, the 200 OK  
> includes
> "Expires: 60", but sofia-sip logs this:
>
> "nua(): refresh register after 1905 seconds (in [900..2700])".
>
> Here is the 200 OK content:
>
> Status-Line: SIP/2.0 200 OK
> Message Header:
>   To: ...
>   From: ...
>   Call-ID: ...
>   Via: ...
>   User-Agent: ...
>   Max-Forwards: ...
>   Contact: sip:6...@192.168.72.128:5060
>   Cseq: 118227582 REGISTER
>   Expires: 60
>   Content-Length: 0
>
> Do you know why the timer could be wrong?  It looks like it's  
> getting set to
> the default 3600 seconds.
>
> Best Regards,
> Jerry
>
>
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
>
>
>
>
>
>
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Sofia-sip-devel mailing lis

[Sofia-sip-devel] Changing IP address.

2009-07-31 Thread Jen Chitty
Hi,

I'm wondering if there's a way to change the IPv4 address that the Sofia 
stack binds to without having to shutdown and restart the stack.  We're 
using the NUA.

Right now, if our device's IPv4 address changes we shutdown the Sofia 
stack and start it up again.  This seems to mostly work, but we are 
experiencing some race conditions with callbacks from the Sofia event loop 
thread (running su_root_run) and our application thread, especially with 
respect to handle destruction.  We were hoping that we could just leave 
the Sofia stack running and tell it to change its IPv4 address.

Another question that I'd like an answer to is this:  When shutting down 
the Sofia stack, are we guaranteed to receive a nua_i_terminated event for 
every session that hasn't yet been terminated?

Thanks very much.

--JT

J. T. Chitty, Chief Software Engineer
VTech Technologies Canada, Ltd.
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Changing IP address.

2009-07-31 Thread Michael Jerris


On Jul 31, 2009, at 2:23 PM, Jen Chitty wrote:



Hi,

I'm wondering if there's a way to change the IPv4 address that the  
Sofia stack binds to without having to shutdown and restart the  
stack.  We're using the NUA.


Nope, but would be nice.



Right now, if our device's IPv4 address changes we shutdown the  
Sofia stack and start it up again.  This seems to mostly work, but  
we are experiencing some race conditions with callbacks from the  
Sofia event loop thread (running su_root_run) and our application  
thread, especially with respect to handle destruction.  We were  
hoping that we could just leave the Sofia stack running and tell it  
to change its IPv4 address.


Another question that I'd like an answer to is this:  When shutting  
down the Sofia stack, are we guaranteed to receive a  
nua_i_terminated event for every session that hasn't yet been  
terminated?


That is the intention, if your not, its a bug.



Thanks very much.

--JT

J. T. Chitty, Chief Software Engineer
VTech Technologies Canada, Ltd.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] REGISTER Refreshing Error?

2009-07-31 Thread Jerry Richards
Hello,

SIP Contact Headers should always be the URL of the device sending the
message (i.e. the address at which the sender can be contacted/replied-to).
So I would always expect the Contact Header in the 200 OK to be the URL of
the sender (not the URL of the receiver).  This is why I don't understand
why sofia-sip is comparing the sent and received Contact Header URLs.

Also, the expires value can be sent either as a parameter in the Contact
Header or as a separate Expires SIP header.  A client may suggest an expires
value in the REGISTER request, but the server is allowed come back with a
different expires value in the 200 OK reply.  In any case, the client (i.e.
sofia-sip) must adhere with the expires value in the 200 OK reply.

This is my understanding of the SIP standard.

Best Regards,
Jerry


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel