Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) One way audio problem and back-INVITE messages (Read 24105 times)
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
One way audio problem and back-INVITE messages
16. Mar 2012 at 23:14
Print Post  
I make a call from SIP client (CSipSimple or CSS) to PhonerLite (PL).
1. Call was answered by PL
2. In a couple of seconds PL sends its own INVITE message back with the same Call-ID, but with reversed From/To fields (as call made from PL back to CSS)... And that breaks the audio channel.

Details. SIP client is CSipSimple (CSS) softphone, running on Android. It supports only one codec at a time. The way how it works now is:
1. CSS sends INVITE with SDP, containing set of available codecs
2. Another party (PL, in this case) answers the call, sending OK/INVITE message with its own set of supported codecs
3. CSS sends second INVITE message, now containing only one codec (supported by both CSS and PL)
4. PL replies with OK/INVITE message with SDP containing that one codec
At this point the call begins successfully. Audio comes and goes in both directions just as it should.

Then, in a couple of seconds, PL suddenly sends new INVITE with the same Call-ID, but now it has From/To reverted and SDP contains full set if supported codecs again. That message breaks audio coming from PL to CSS.

Case is 100% repeatable. 

Now, if I make call in opposite direction (from PL to CSS) there are 2 cases:
1. I pick up CSS within next 2 sec of ringing (time is approximate here), the audio between two parties is always OK
2. I pick up CSS after that time, there is no audio from PL to CSS. The audio from CSS to PL is always OK though.

It's weird, but it's PhonerLite specific. If I use CSS with other SIP clients (calling to them or from them), I don't have any such problems at all.

PhonerLite v1.97 running on WXP.
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #1 - 17. Mar 2012 at 06:54
Print Post  
Are you using a special VoIP server/provider or do you make direct IP calls between both endpoints? Are both devices (mobile phone and PC) in the same (W)LAN?
  
Back to top
WWW  
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #2 - 17. Mar 2012 at 23:12
Print Post  
All calls go via FreeSWITCH SIP server. I can monitor its logs.

Smartphone (running CSS), PC (running PhonerLite) and server, running FreeSWITCH use separate networks. All they have different WAN IP's. SIP server is configured to provide direct media mode for all calls between CSS and PL.
  
Back to top
 
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #3 - 17. Mar 2012 at 23:18
Print Post  
As I mention in 1st post, I can see re-INVITE messages sent by CSS for the purpose of negotiating just one codec. That's OK. But what I can't understand is why in couple of seconds after the call is established the PhonerLite sends its own INVITE message back to CSS with the same Call-ID, but with switched parties in it. That message now contains "From: PhonerLite" and "To: CSS"...
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #4 - 18. Mar 2012 at 12:34
Print Post  
What is your problem with "switch" from and to? That is normal! Example:
1) incoming INVITE received by CSS with from is "ABC" and to is "XYZ"
2) after call establishment CSS disconnects a call with BYE: from is "XYZ" and to is "ABC"

PhonerLite sends a re-INVITE only of no data (RTP) is received at all after 5 seconds. I asume that is the problem in your situation.
I installed CSipSimple from the market. I used my PC running PhonerLite as registrar. That built in registrar in PhonerLite is just for testing purposes.
Initiating calls from CSS to PhonerLite is exactly as you described. CSS sends some codecs and PhonerLite answers with all codecs that are supported by both of them - that is normal behavior. After that CSS sends a re-INVITE with only one codec. I have a call with media in both directions - no problems at all here.

I don't have a Freeswitch between.
So I need a Wireshark trace from you on PhonerLite side to see all messages and media flows.
  
Back to top
WWW  
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #5 - 18. Mar 2012 at 22:46
Print Post  
Actually, the problem is - after several seconds the call is loosing audio from PL to CSS.
Quote:
Initiating calls from CSS to PhonerLite is exactly as you described. CSS sends some codecs and PhonerLite answers with all codecs that are supported by both of them - that is normal behavior. After that CSS sends a re-INVITE with only one codec. I have a call with media in both directions - no problems at all here.
No problems here at this time too. There is audio from and to CSS, in both direction. But just in a couple of seconds, PL suddenly sends "back-INVITE" with full set of codecs, and at that time CSS looses its ability to convey audio to PH. The audio from PL to CSS continue to work. May be it's a coincidence or may be it's the actual cause of braking audio from CSS to PL.

Again, all my phones (and SIP switch) are located on their own respective LAN's (behind NAT routers) offering correct WAN IP's in their SDP. I was able to maintain audio from both directions for a long time before. And I can do it now if I use the case 1 from my 1st post:
Quote:
Now, if I make call in opposite direction (from PL to CSS) there are 2 cases:
1. I pick up CSS within next 2 sec of ringing (time is approximate here), the audio between two parties is always OK
2. I pick up CSS after that time, there is no audio from PL to CSS. The audio from CSS to PL is always OK though.

The weird thing is - there is a similar (about first 2 sec) interval that is important to make the audio work or not too. It may be related or may be not. I mentioned it just in case if it helps.

But let's focus on the call from CSS to PL first and the problem of loosing audio from CSS to PL after several seconds of initially successful call.
  
Back to top
 
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #6 - 18. Mar 2012 at 22:58
Print Post  
BTW, I forgot to mention, that the author of CSipSimple always suggests to use latest developers version (not one, that is published on the Market, wich is quite obsolete). He provides detailed instructions how to do it on this page:
http://code.google.com/p/csipsimple/wiki/HowToInstallDevVersion

After you install the developer's version, it's very easy to check/get latest updates. Just go to its "Help" and click on "Update nightly build" and everything will be done automatically, no any manual download is required.

Currently I'm running the latest r1330 revision.

  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #7 - 19. Mar 2012 at 07:29
Print Post  
Once again: A re-INVITE from PhonerLite is only sent, if NO RTP packet arrived within the FIRST 5 seconds of the call.
Please send me a Wireshark trace of such a call to my e-mail address. Then I can see if you are using SRTP or ZRTP or whatever that may cause the problem.
  
Back to top
WWW  
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #8 - 05. Jun 2012 at 01:25
Print Post  
I'm running the latest 2.00 version now. And at this time the audio problem is reversed. When I call from CSS to PL after I answer the call in PL there is no audio at all for about first 4 sec. Then audio recovers in both directions.

What I've noticed in PL's debug window is:
When call is answered, PL sends its OK INVITE message. SDP contains 5062 port (m=audio 5062 RTP/AVP 0 101). At this point there is no media stream in both directions. Approximately in 4 sec PL sends its re-INVITE message, but at this time it refers a completely different port - 5135 (m=audio 5135 RTP/AVP 0 97 8 2 3 110 111 9 101) and after common re-negotiation with CSS for using just one codec, the audio becomes functional well in both directions.

What is the port 5062? Why it's replaced with port 5135 in PL's INVITE that it sends in 4 sec? Why PL doesn't send port 5135 in first place?

It looks to me that with 1st port 5062 the audio is not working, while with the second port 5135 it does. Could it be the source of the problem?

BTW, when I call from PL to CSS and answer immediately, the audio is OK in both directions right from the beginning. If I delay with answer for more then 3 sec (approximately), there will be no audio from PL to CSS, while form CSS to PL will be just fine... It's all 100% repeatable and quite weird.
  
Back to top
 
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #9 - 05. Jun 2012 at 06:32
Print Post  
OK. To find out where the bug is I've conducted similar tests in the same environment with 3rd type of SIP phone - OBi100 ATA. And results are completely similar to CSS (mentioned in previous post):

1. When call is made from a SIP phone (CSS or OBi100) to PL and answered by PL, the first 4 sec are completely silent (no audio at all). Then audio appears and works well.

2. When call made from PL to a SIP phone (CSS or OBi100) and the called party picks up the call immediately - there is audio in both direction, right from the beginning. If the called party picks up the call after some time (more then 3-4 sec since ringing begins) - there is no audio from PL to SIP phone (CSS or OBi100), but there is audio from SIP phone to PL..

3. When I make similar calls between other two SIP phones (CSS and OBi100, excluding PL) the call always works. There is audio in both directions, right from the beginning, all the times (independently form time period before call is answered).

Therefore conclusion is - the problem is somewhere within the PL v.2.00...
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #10 - 05. Jun 2012 at 08:22
Print Post  
Do you have that problems only with activated ZRTP or any other encryption enabled? If so, please check with completely disabled encryption (SRTP, ZRTP, TLS).
I don't have a Freeswitch environment here. So can you please do a Wireshark trace of such calls and send the trace by e-mail?
I can't reproduce that problem here, so I need that trace to analyze the problem.
  
Back to top
WWW  
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #11 - 05. Jun 2012 at 22:33
Print Post  
I don't use SRTP and ZRTP. On Codecs page other options are:
* G.711 u-Law 64 kbps - first coded to use
* SRTP - unchecked
* ZRTP - unchecked
* MOH - checked with "no silence detection" chosen
* G.726 AAL2 - checked

In all tests described earlier I did not use any encryption (so far, I'm going to after we solve this problem though).

I closely analyzed logs generated on both sides (in PL and FS) and have found nothing suspicious at all (otherwise, I'd send it here immediately). I don't have Wireshark installed on FS computer (it's a remote computer). Could I give you debug log from PL? Should I somehow increase level of details in that log?

Do you have any idea why PL when answers the incoming call, offers one port for media (which doesn't work) and then, in 4 sec, changes it for another one (which works correctly)? Why PL doesn't offer that port in the first place?

Just to remind you that PL is behind NAT and all PL, FS, OBi100 and CSS are all in the different networks. May be that will help you to get an idea, where the problem could be... Again, when I use CSS and OBi100 SIP clients in the very same environment, there is no any problem with incoming/outgoing calls. Only PL shows it and does it consistently.
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #12 - 06. Jun 2012 at 08:09
Print Post  
Debug in PhonerLite only shows SIP message, but not the RTP data.
If you are using NAT, do you have configured a STUN server?
If another softphone (X-Lite, NinjaLite, Zoiper, Jitsi, 3CXphone, ...) works without problems, but latest PhonerLite version not - then only a Wireshark trace on the PC can compare the differences.
  
Back to top
WWW  
IP Logged
 
Foner88
YaBB Newbies
*
Offline


Phoner is great!

Posts: 41
Joined: 19. Jul 2011
Re: One way audio problem and back-INVITE messages
Reply #13 - 07. Jun 2012 at 05:17
Print Post  
No, I don't. "STUN server" in "Server" tab is empty. In "Network" tab there is "UPnP NAT" box checked. PL has always worked with this configuration just fine until I started this thread. The problem appeared in v1.97, where sound disappear after 3-5 sec from beginning of the talk time (see my first post). With the latest version v2.00 the problem somehow gets reverted. Now the sound is OK after those several seconds, but not before. It's exactly an opposite to what I've seen with v1.97...
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11421
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: One way audio problem and back-INVITE messages
Reply #14 - 08. Jun 2012 at 08:52
Print Post  
As long I can't test for my own, I can't do anything. Sorry. Do you have a test account?
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint