Bug 163322 - kphone ignores STUN setting for RTP
Summary: kphone ignores STUN setting for RTP
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kphone
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-15 04:21 UTC by Stefan Becker
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-05 21:39:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Correct initialization of useStun instance variable in CallAudio constructor (502 bytes, patch)
2005-07-15 04:28 UTC, Stefan Becker
no flags Details | Diff

Description Stefan Becker 2005-07-15 04:21:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
When using kphone with UDP protocol behind a NAT firewall the STUN protocol is used to correctly report the outside IP address/port number of the local UDP ports to the remote site.

Starting with kphone 4.1.0 the STUN functionality is broken for RTP sockets, ie. the SIP communication and audio local->remote works OK, but incoming audio doesn't work anymore

Version-Release number of selected component (if applicable):
kphone-4.1.1-1.fc4

How reproducible:
Always

Steps to Reproduce:
1. setup kphone to use a STUN server
2. kphone | tee kphone.log
3. make a phone call 
  

Actual Results:  From the log:

Found 2 interfaces.
SipClient: Listening UDP on port: 5060
SipClient: Our address: 192.168.2.2
SipClient: STUN request
SipClient: Receiving message...
SipClient: STUN response
   address_port:   22207
   address:        <outside IP address of the NAT firewall>

...

KCallWidget: Switching calls...
CallAudio: listening for incomming RTP
UDPMessageSocket: Listening on 32800
CallAudio: Opening ALSA device for Output
CallAudio: Creating RTP->ALSA Diverter

...

Expected Results:  From the log:

Found 2 interfaces.
SipClient: Listening UDP on port: 5060
SipClient: Our address: 192.168.2.2
SipClient: STUN request
SipClient: Receiving message...
SipClient: STUN response
   address_port:   22207
   address:        <outside IP address of the NAT firewall>

...

KCallWidget: Switching calls...
CallAudio: listening for incomming RTP
UDPMessageSocket: Listening on 32800
DspOutRtp: STUN request
SipClient: Receiving message...
SipClient: STUN response for RTP
CallAudio: Opening ALSA device for Output
CallAudio: Creating RTP->ALSA Diverter

...


Additional info:

Comment 1 Stefan Becker 2005-07-15 04:28:28 UTC
Created attachment 116790 [details]
Correct initialization of useStun instance variable in CallAudio constructor

The constructor for the class CallAudio first sets useStun instance variable
according to the user settings but then overwrites it with "false". The patch
moves the initialization with "false" to the correct place.

Note: This patch is against the kphone-4.2 source code but should be applicable
to 4.1.x too...

Comment 2 Ignacio Vazquez-Abrams 2005-08-05 06:16:40 UTC
It seems that Denis Gilmore, the new maintainer for kphone, found a problem with
the patch. Reopening.

Comment 3 Dennis Gilmore 2005-08-05 11:13:47 UTC
With the patch applied  kphone segfaulted 95% of the time when  making a call. 
 
strace  of segfault 
munmap(0xb7d88000, 4096)                = 0 
fcntl64(11, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 
0xbf9d0378) = 0 
close(11)                               = 0 
bind(10, {sa_family=AF_INET, sin_port=htons(0), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0 
getsockname(10, {sa_family=AF_INET, sin_port=htons(33160), 
sin_addr=inet_addr("0.0.0.0")}, [16]) = 0 
write(1, "UDPMessageSocket: Listening on 3"..., 37UDPMessageSocket: Listening 
on 33160 
) = 37 
--- SIGSEGV (Segmentation fault) @ 0 (0) --- 
+++ killed by SIGSEGV +++ 
 

Comment 4 Stefan Becker 2005-08-05 19:24:39 UTC
Sorry, I fail to see why the patch should cause SIGSEGV, as a variable
initialization is moved inside the same routine by about 10 lines.

I haven't noticed any problems on my computer with kphone-4.2.

Comment 5 Dennis Gilmore 2005-08-06 02:51:07 UTC
I dont see why it would cause it the segfault  either  however  i tried it on 
3 different machines  all with the same result.  I could not make calls.  i 
removed the patch  and kphone  worked as expected for me.  All my machines are 
running rawhide or FC4  i tested on both.  i do not have any FC3 boxes i could 
test on.  i will look into this further  but i didnt want others to have 
kphone in an unworkable state.  It could be a bug with asterisk.  My test 
calls were all on the same lan and all going through asterisk.  I tested on 
two different asterisk servers. i will try some calls dirrectly between two 
machines  both with the patch applied. 

Comment 6 Dennis Gilmore 2006-02-05 21:39:32 UTC
Just a FYI i queued a new build that reenables the STUN patch.  my quick 
testing  it did not segfault on rawhide.  i also patched configure  so it uses 
standard CFLAGS and not -O3  


Note You need to log in before you can comment on or make changes to this bug.