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

2009-10-02 Thread Pekka Pessi
2009/10/2 Robert Han 
> I just want to raise the issue that we asked you earlier back in July 31 (see 
> below).
>
> You said that if we shutdown the sofia stack, and if there are outstanding 
> sip sessions (for example 4 active sessions), we do not need to nua_bye() or 
> even nua_handle_destroy() before invoking nua_shutdown().
>
> according to your reply, the nua stack is guaranteed to terminate outstanding 
> nua operations, and then publish nua_i_terminate as the final event with a 
> operation handle, so that we can destroy that handle.
>
> that never happened.

That *should* happen. however, the IP address change also means that
all the TCP connections and the UDP sockets bound to the old IP
address become useless. Do you include maddr= parameter in the
NUTAG_URL() in nua_create()?

--Pekka

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


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

2009-10-02 Thread Robert Han
no.

nua_create()/nta_agent_create()/tport_bind() now joins to multicast group 
if "maddr" parameter is specified.

this not applicable to our application. We don't have a proxy server or a 
registrar server.

 currently this is how we create the nua instance:

portPtr->sofiaStackPtr = nua_create(portPtr->eventLoopPtr,
EventCallback,  // Event 
handling callback func.
portPtr,// Additional 
data to pass to callback.
TAG_END()); //  End of 
tag list 


we felt this was not needed to force a hard binding of the socket to a 
local NIC address.:

NUTAG_URL(Address), // Local address to bind to. 


if we do not recycle the stack, the nua stack nta layer will error out on 
the transmission on a port that is no longer valid (because the address is 
changed).

-NTC-[20021003:105001.720]|  100||cc||sip.fe|vt_sip_Invite: 
IsSophiaStackOnline = [1]
 DBG [20021003:105001.720]|  100||cc||sip.fe 
|GenerateSdpMediaDesc: Generated SDP: 'm=audio 10050 RTP/AVP 0 18'
 DBG [20021003:105001.720]|  100||cc||sip.fe||sipHndl|Bind: 
Session 10b bound to handle 1000f618.
tport_vsend(0x100106f0): Invalid argument with (s=17 */169.254.1.185:5060)
nta: INVITE (10702764): Invalid argument (22) with */[169.254.1.185]:5060
 DBG [20021003:105001.740]|  166||SIP Event Handler||sip.fe 
|EventCallback: Received an event nua_i_state status 0 INVITE sent on port 
5060. Handle = 0x1000f618, HMagic = 0x10b.
 DBG [20021003:105001.740]|  166||SIP Event Handler||sip.fe |StateChange: 
Changed NUA call state to nua_callstate_calling.
 DBG [20021003:105001.740]|  166||SIP Event Handler||sip.fe 
|EventCallback: Received an event nua_r_invite status 503 Service 
Unavailable on port 5060. Handle = 0x1000f618, HMagic = 0x10b.
[WRN][20021003:105001.740]|  166||SIP Event Handler||sip.fe 
|InviteResponse: Sending SIP Invite Error Response due to Ethernet link 
down
 DBG [20021003:105001.740]|  166||SIP Event Handler||sip.fe 
|EventCallback: Received an event nua_i_state status 503 Service 
Unavailable on port 5060. Handle = 0x1000f618, HMagic = 0x10b.
 DBG [20021003:105001.750]|  166||SIP Event Handler||sip.fe |StateChange: 
Changed NUA call state to nua_callstate_terminated.
 DBG [20021003:105001.750]|  166||SIP Event Handler||sip.fe 
|EventCallback: Received an event nua_i_terminated status 503 Service 
Unavailable on port 5060. Handle = 0x1000f618, HMagic = 0x10b.
 DBG [20021003:105001.750]|  166||SIP Event Handler||sip.fe 
||sipHndl|Terminated: Handle (1000f618) terminated.
 DBG [20021003:105001.750]|  166||SIP Event Handler||cc.be 
||CC_GroupRing|SipEventCallback: Received SIP event callback with reason 
'VT_SIP_CBR_TERMINATED', cbParam = [0x205], session = [0x10b]


hence whether we specific a URL address for nua to bind to, or it picks a 
loca address by default, I thought it wouldn't matter.








Pekka Pessi 
10/02/2009 08:11 AM
 
To: Robert Han 
cc: sofia-sip-devel@lists.sourceforge.net
Subject:Re: [Sofia-sip-devel] Fw: Changing IP address.


2009/10/2 Robert Han 
> I just want to raise the issue that we asked you earlier back in July 31 
(see below).
>
> You said that if we shutdown the sofia stack, and if there are 
outstanding sip sessions (for example 4 active sessions), we do not need 
to nua_bye() or even nua_handle_destroy() before invoking nua_shutdown().
>
> according to your reply, the nua stack is guaranteed to terminate 
outstanding nua operations, and then publish nua_i_terminate as the final 
event with a operation handle, so that we can destroy that handle.
>
> that never happened.

That *should* happen. however, the IP address change also means that
all the TCP connections and the UDP sockets bound to the old IP
address become useless. Do you include maddr= parameter in the
NUTAG_URL() in nua_create()?

--Pekka

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


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

2009-10-02 Thread Robert Han
Thanks for the quick reply, we are using Linux 2.4  with BusyBox.

compiler is gcc v2.9.5.3  run-time library = uClibc 0.9.19

Sofia stack version is 1.12.10.






Francesco Lamonica 
10/02/2009 12:17 AM
 
To: Robert Han 
cc: sofia-sip-devel@lists.sourceforge.net
Subject:Re: [Sofia-sip-devel] Fw: Changing IP address.


Hello Robert, 
may i ask what platform and sofia version are use using? I am facing the 
same issue but i dont'even get the nua_r_shutdown message...

thanks

On Thu, Oct 1, 2009 at 11:28 PM, Robert Han  wrote:

Hi, 

I just want to raise the issue that we asked you earlier back in July 31 
(see below). 

You said that if we shutdown the sofia stack, and if there are outstanding 
sip sessions (for example 4 active sessions), we do not need to nua_bye() 
or even nua_handle_destroy() before invoking nua_shutdown(). 

according to your reply, the nua stack is guaranteed to terminate 
outstanding nua operations, and then publish nua_i_terminate as the final 
event with a operation handle, so that we can destroy that handle. 

that never happened. 

our logs below an IP address change, where we had to recycle the Sofia sip 
stack: 


our link status monitor reports an IP address change, so we proceed to 
recycle our Sofia stack: 

-NTC-[20021020:112634.600]|  104||cc||sip.fe   
 |DevCoordStatusChange: SIP: NETWORK UP 
-NTC-[20021020:112634.600]|  104||cc||sip.fe   
 |DevCoordStatusChange: Network Link Recycled ==> possible new IP address 
change 
-NTC-[20021020:112634.600]|  104||cc||sip.fe   
 |DevCoordStatusChange: IP address changed from 192.168.0.52 to 
192.168.0.77. 
-NTC-[20021020:112634.610]|  104||cc||sip.fe   
 |DevCoordStatusChange: Need to recycle Sophia Stack ===> shutting down 
the Sophia SIP stack... 

IsSofiaStackShuttingDown = TRUE; 

VT_NOTICE("Shutting down the Sofia SIP Stack..."); 

nua_shutdown(PortPtr->sofiaStackPtr);   

===> now i expect Sofia stack to terminate the nua operation for each 
outstanding sip session with nua_i_terminated before receiving 
nua_r_shutdown 
completion status , but we don't get it hence we don't destroy the nua 
handle. 


 DBG [20021020:112635.680]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Received an event = ['nua_r_shutdown'] status = [100 
,'Shutdown started'] on port [5060]. Handle = [(nil)], HMagic = (nil). 
-NTC-[20021020:112635.680]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Sophia SIP stack shutdown started successfully. 
 DBG [20021020:112635.810]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Received an event = ['nua_r_shutdown'] status = [200 
,'Shutdown successful'] on port [5060]. Handle = [(nil)], HMagic = (nil). 
-NTC-[20021020:112635.810]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Sophia SIP stack shutdown completed successfully. 
-NTC-[20021020:112635.820]|  168||SIP Event Handler||sip.fe   
 |EventCallback: ---> StartSipStack() 
nta_agent: received garbage from udp/192.168.0.77:5060/sip 
nta_agent: received garbage from udp/127.0.0.1:5060/sip 
-NTC-[20021020:112635.850]|  168||SIP Event Handler||sip.fe   
 |EventCallback: <--- StartSipStack() 
 DBG [20021020:112635.850]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Received an event = ['nua_r_set_params'] status = [200 
,'OK'] on port [5060]. Handle = [(nil)], HMagic = (nil). 
 DBG [20021020:112635.850]|  168||SIP Event Handler||sip.fe   
 |EventCallback: Discarding event nua_r_set_params.  Handler not 
implemented. 



because we don't recieve the nau_i_terminate, we have a *stale* handle on 
our side, where we did not destroy it, but our client-side binding Session 
context object is already deleted. 

would that be a bug? is the Sofia stack suppose to behave as described 
above??   

thanks, 
Robert Han, Senior Software Engineer 
VTech Technologies Canada, Ltd. 


- Forwarded by Robert Han/ENG/VTNCAN/VTECH on 10/01/2009 02:01 PM 
- 

Jen Chitty 
07/31/2009 12:01 PM 

To:Robert Han/ENG/VTNCAN/vt...@vtech 
cc: 
Subject:Fw: [Sofia-sip-devel] Changing IP address.



- Forwarded by Jen Chitty/ENG/VTNCAN/VTECH on 07/31/2009 11:57 AM 
- 

Michael Jerris  
07/31/2009 11:47 AM 

To:Jen Chitty  
cc:sofia-sip-devel  

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




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 applicatio

Re: [Sofia-sip-devel] How do I do nua to respond 488 using SOA

2009-10-02 Thread Daniel Eli
In other words, how do I generate the sdp answer (using SOA) before nua_respond 
(200) ?


--- On Thu, 10/1/09, Paulo Pizarro  wrote:

> From: Paulo Pizarro 
> Subject: [Sofia-sip-devel] How do I do nua to respond 488 using SOA
> To: sofia-sip-devel@lists.sourceforge.net
> Date: Thursday, October 1, 2009, 5:51 PM
> Hi all,
> 
> On the "basic" inbound call model:
> 
> 
>APPL  NUA SOAREMOTE
>   |   |   |   |
>  0  | |   |   |
>  1|   |<--INVITE(sdp offer)---|
>  2  | |   |   |
>  3|   |--set_remote-->|   |
>  4  | |   |   |
> 
>  5|<---INVITE-|   |   |
>  6  | |   |   |
>  7  | |   |   |
>  8|- - -180- - - >|   |   |
>  9|   |- - - - - - - - - - 180 Ringing - - - >|
> 10  | |   |   |
> 11  | |   |   |
> 12|-200-->|   |   |
> 
> 13|   |--set_params-->|   |
> 14  | |   |   |
> 15|   |--gen_answer-->|   |
> 16|   |   |   |
> 17| 18|   |activate-->|   |
> 19|   |200 (sdp answer)-->|
> 
> 20|   |   |   |
> 21|   |   |   |
> 22|   | 23|<-ACK--|   |   |
> 24|   |   |   |
>   |   |   |   |
> In line 12, the application calls nua_respond with
> 200, if there is no common codecs, soa generates an answer
> SDP with "m=audio 0 RTP/AVP 0 8".
> 
> 
> How do I make nua to respond 488 using soa?
> 
> Thanks in advance,
> 
> Paulo Pizarro
> 
> 
> 
>  
> 
> -Inline Attachment Follows-
> 
> --
> Come build with us! The BlackBerry® Developer
> Conference in SF, CA
> is the only developer event you need to attend this year.
> Jumpstart your
> developing skills, take BlackBerry mobile applications to
> market and stay 
> ahead of the curve. Join us from November 9-12, 2009.
> Register now!
> http://p.sf.net/sfu/devconf
> -Inline Attachment Follows-
> 
> ___
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
> 


  

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


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

2009-10-02 Thread Francesco Lamonica
Hello Robert,
may i ask what platform and sofia version are use using? I am facing the
same issue but i dont'even get the nua_r_shutdown message...

thanks

On Thu, Oct 1, 2009 at 11:28 PM, Robert Han  wrote:

>
> Hi,
>
> I just want to raise the issue that we asked you earlier back in July 31
> (see below).
>
> You said that if we shutdown the sofia stack, and if there are outstanding
> sip sessions (for example 4 active sessions), we do not need to nua_bye() or
> even nua_handle_destroy() before invoking nua_shutdown().
>
> according to your reply, the nua stack is guaranteed to terminate
> outstanding nua operations, and then publish nua_i_terminate as the final
> event with a operation handle, so that we can destroy that handle.
>
> that never happened.
>
> our logs below an IP address change, where we had to recycle the Sofia sip
> stack:
>
>
> our link status monitor reports an IP address change, so we proceed to
> recycle our Sofia stack:
>
> -NTC-[20021020:112634.600]|  104||cc||sip.fe
>  |DevCoordStatusChange: SIP: NETWORK UP
> -NTC-[20021020:112634.600]|  104||cc||sip.fe
>  |DevCoordStatusChange: Network Link Recycled ==> possible new IP address
> change
> -NTC-[20021020:112634.600]|  104||cc||sip.fe
>  |DevCoordStatusChange: IP address changed from 192.168.0.52 to
> 192.168.0.77.
> -NTC-[20021020:112634.610]|  104||cc||sip.fe
>  |DevCoordStatusChange: Need to recycle Sophia Stack ===> shutting down the
> Sophia SIP stack...
>
> IsSofiaStackShuttingDown = TRUE;
>
> VT_NOTICE("Shutting down the Sofia SIP Stack...");
> nua_shutdown(PortPtr->sofiaStackPtr);
>
> *===> now i expect Sofia stack to terminate the nua operation for each
> outstanding sip session with nua_i_terminated before receiving
> nua_r_shutdown *
> *completion status , but we don't get it hence we don't destroy the nua
> handle.*
>
>
>  DBG [20021020:112635.680]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Received an event = ['nua_r_shutdown'] status = [100
> ,'Shutdown started'] on port [5060]. Handle = [(nil)], HMagic = (nil).
> -NTC-[20021020:112635.680]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Sophia SIP stack shutdown started successfully.
>  DBG [20021020:112635.810]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Received an event = ['nua_r_shutdown'] status = [200
> ,'Shutdown successful'] on port [5060]. Handle = [(nil)], HMagic = (nil).
> -NTC-[20021020:112635.810]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Sophia SIP stack shutdown completed successfully.
> -NTC-[20021020:112635.820]|  168||SIP Event Handler||sip.fe
>  |EventCallback: ---> StartSipStack()
> nta_agent: received garbage from udp/192.168.0.77:5060/sip
> nta_agent: received garbage from udp/127.0.0.1:5060/sip
> -NTC-[20021020:112635.850]|  168||SIP Event Handler||sip.fe
>  |EventCallback: <--- StartSipStack()
>  DBG [20021020:112635.850]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Received an event = ['nua_r_set_params'] status = [200
> ,'OK'] on port [5060]. Handle = [(nil)], HMagic = (nil).
>  DBG [20021020:112635.850]|  168||SIP Event Handler||sip.fe
>  |EventCallback: Discarding event nua_r_set_params.  Handler not
> implemented.
>
>
>
> because we don't recieve the nau_i_terminate, we have a *stale* handle on
> our side, where we did not destroy it, but our client-side binding Session
> context object is already deleted.
>
> would that be a bug? is the Sofia stack suppose to behave as described
> above??
>
> thanks,
> Robert Han, Senior Software Engineer
> VTech Technologies Canada, Ltd.
>
>
> - Forwarded by Robert Han/ENG/VTNCAN/VTECH on 10/01/2009 02:01 PM -
>   *Jen Chitty*
>
> 07/31/2009 12:01 PM
>
> To:Robert Han/ENG/VTNCAN/vt...@vtech
> cc:
> Subject:Fw: [Sofia-sip-devel] Changing IP address.
>
>
> - Forwarded by Jen Chitty/ENG/VTNCAN/VTECH on 07/31/2009 11:57 AM -
>   *Michael Jerris *
>
> 07/31/2009 11:47 AM
>
> To:Jen Chitty 
> cc:sofia-sip-devel 
> Subject:Re: [Sofia-sip-devel] Changing IP address.
>
>
>
> 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 r