views:

185

answers:

1

Hi,

I hope this would be my last question about this SIP subject, I have managed to overcome the last issue I had by asking a friend to help me from a remote computer, I'm able to connect between the computers, but here is the thing, according to all the examples I saw, the Callee should invoke the Ringing response, but in my application case I didn't implement it yet, but I still receive on the Caller UAC a Ringing response, this is the SIP messages that are on the caller end:

Outgoing Request 5:

INVITE sip:[email protected] SIP/2.0
Contact: "Client 310" <sip:[email protected]>
From: "Client 310" <sip:[email protected]>
Max-Forwards: 32
CSeq: 2 INVITE
Call-ID: [email protected]
Allow: INVITE,CANCEL,ACK,BYE,OPTIONS
Content-Type: application/sdp
Proxy-Authorization: Digest username="310",nonce="012afffb",realm="asterisk",uri="sip:[email protected]",algorithm=MD5,response="d19ca5b98450b4be7bd4045edb8a3a2f"
Via: SIP/2.0/UDP hostName.hn:5060
To: "Client 320" <sip:[email protected]>;tag=as5a8fa200
Content-Length: 257

v=0
o=310 7108915969559970847 7108915969559970847 IN IP4 xxx.xxx.x.xxx
s=-
i=Nu-Art Software - TacB0sS VoIP information
c=IN IP4 xxx.xxx.x.xxx
m=audio 3312 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000

Incoming Response 6:

SIP/2.0 100 Trying
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:[email protected]>
To: "Client 320" <sip:[email protected]>;tag=as5a8fa200
Call-ID: [email protected]
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:[email protected]>
Content-Length: 0

Incoming Response 7:

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:[email protected]>
To: "Client 320" <sip:[email protected]>;tag=as5a8fa200
Call-ID: [email protected]
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:[email protected]>
Content-Length: 0

Call to: [email protected] is Ringing

Incoming Response 8:

SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:[email protected]>
To: "Client 320" <sip:[email protected]>;tag=as5a8fa200
Call-ID: [email protected]
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 27669 27669 IN IP4 yy.yy.yy.yy
s=session
c=IN IP4 yy.yy.yy.yy
t=0 0
m=audio 10914 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

Incoming Response 9:

SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:[email protected]>
To: "Client 320" <sip:[email protected]>;tag=as5a8fa200
Call-ID: [email protected]
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Content-Length: 0

I do not respond to the invite, that is why all this is happening, but why am I getting a ringing if I'm not the one sending it.

Thanks,

Adam.

Update:

If you will notice the times that I get the responses:

Incoming Response 7: 1275879030656 Ringing

Incoming Response 8: 1275879038734 Session Progress

Incoming Response 9: 1275879038781 Service Unavailable

I don't understand the logic here, I have 8 sec from the first Ringing to the session progress, but from the Session Progress to the Service Unavailable I have 47ms?

How does this makes sense? 50 ms to do what? time to analyze the response + time to open an RTP session + time to construct a response + time to construct SDP + time it takes the server to receive the message - the time it takes the 503 message to arrive to my UAC, isn't this cutting little close? at which point am I suppose to response to the server?

Thanks again for all your help Wiz.

+2  A: 

Because the FreeSwitch server you are calling is a B2BUA and must be configured to generate ring back independently of the forwarded call leg. If the server you were calling was a SIP Proxy without B2BUA capabilities you would not get any ringing or other reponses until the SIP device at the far end responded.

Responses 7 and 8 will cause your softphone to ring. For response 7, 180 Ringing, it's up to your softphone to generate the tone. For response 8, 183 Session Progress with RTP, your softphone will receive a progress indication from the FreeSwitch server that it should be rendering.

Update: The reason for the timings you're seeing are again down to the fact that you're placing the call to a B2BUA, in this case FreeSwitch. It looks like it's configured to send a Ringing response automatically when a new call is received and in the meantime it is processing its dialplan to work out what to do with the call. Somewhere in that dialplan there appears to be a command to indicate session progress which is where the 183 response comes in but then it must get to the end of the dialplan or encounter an error which results in the 503 response.

It's unlikely you would get the same pattern of responses if you were communicating directly to a UAS.

The only action required from your end of the call, you are acting as the UAC, is to ACK the final response, in this case the 503. Your SIP stack does need to do something with the 180 and 183 responses to let the user know what's happening but you don't need to respond to them as they are what's called informational responses and the UAS doesn't want a response to them. There actually is an enhancement to the SIP standard dealing with reliable processing of provisional responses but it's optional and I wouldn't worry about it at this point if I was you.

sipwiz
generate the tone? rendering?I'm not familiar with these terms...
TacB0sS
you mean start sending RTP packets?
TacB0sS
Generate refers to the audio that your SIP device will play when it receives a certain response without RTP such as 180 Ringing (180 ringing can also have RTP but it's optional). Render refers to the audio that your SIP device will play when it does have an RTP stream available. Generate and render are not formal terms rather they are descriptive ones I have used to explain what's going on.
sipwiz
Thank you for the explanation. I do understand what I need to do, I just don't seem to understand the order of things, as you can see in the update I posted, the numbers just don't add up, if I should start transmitting RTP packets, I need to get the IP to transmit to, and it only comes with the Session Progress, and if you'll look at the time frame, perhaps I'm wrong but this seem silly, since the server could wait 1 sec, but I have 50 ms to respond?
TacB0sS
The B2BUA tries to set up the callee's leg (what sipwiz calls the forwarded leg) - the call between it and the callee - as soon as it receives your INVITE. It may, at its discretion, periodically send 183s. It just happened that it sent the 183 just before the callee leg failed (hopefully with the same response status-code as you received). In other words: running the test again might NOT show a 50ms time difference.
Frank Shearar
you were right, a few times I got the session progress after the 503.I think I get the service unavailable because I don't send the Ringing response back to the B2BUA from the callee. I think I got it: the B2BUA tells both side Caller -> Ringing, Callee -> Invite from Caller, then it has about 8 sec timeout for the Callee to set the ringing back to the B2BUA before is send service unavailable back to the Caller, the Session Progress response, is just a default response I encountered it a few more times when I supplied an invite without SDP, and in another case don't remember which
TacB0sS
Thank you guys, looking into it... although you know, I was looking for B2BUA scheme and all the schemes I saw didn't describe this case, they all sticked to the original UAS example. So that makes me wonder the SIP and SDP are very strict so, at which point did people decide that they can change the rules of the game? I know this does not effect much, but this is wrong to send a ringing from the server before the actual ringing confirmation arrives, No?
TacB0sS
When I wrote a B2BUA a while ago, I originally had it send a 180 Ringing. A colleague of mine convinced me that 180 Ringing should be reserved for when a UA actually tells the user that there's an incoming call, and should merely send back 183s telling the caller what it's doing.
Frank Shearar