[Home]

Summary:ASTERISK-04211: setting rtptimeout per peer basis does not work (probalby rtpholdtimeout, rtpkeepalive too)
Reporter:mateusz kmiec (mateusz kmiec)Labels:
Date Opened:2005-05-18 01:36:26Date Closed:2008-01-15 15:35:36.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:If you set rtptimout for given peer like this:
[peer1]
rtptimout=10

it is NOT USED (in sip_chan.c:do_monitor()), instead global setting ([general]), if any, is used.

In chan_sip.c there is do_monitor() which looks uses sip_pvt structure
to obtain value of rtptimout but this value is always global one.

I've added following in create_addr():
 if (p->rtptimeout != 0)
   r->rtptimeout = p->rtptimeout;
I am not sure if it is the (only) place were this should be initialized.

Probalby the same aplies to rtpholdtimeout, rtpkeepalive.
Comments:By: Kevin P. Fleming (kpfleming) 2005-05-19 00:39:46

This is a problem specifically in chan_sip, as indicated in your notes, so it should have been categorized as "SIP", not "Core Asterisk".

Also, according to the bug posting guidelines, bugs posted against CVS HEAD should be confirmed against a current copy, as opposed to one that is nearly 60 days old. In this case, the code is still buggy, so I'll fix it, but please be more diligent when posting bugs in the future :-)

By: Kevin P. Fleming (kpfleming) 2005-05-19 00:44:42

Fixed in CVS HEAD, thanks for the report!

By: mateusz kmiec (mateusz kmiec) 2005-05-19 03:55:03

kpfleming thanks for fast response

actually bug is not corrected, I checked with current head.
The following code in create_addr()

if (!p->rtptimeout)
r->rtptimeout = p->rtptimeout;
if (!p->rtpholdtimeout)
r->rtpholdtimeout = p->rtpholdtimeout;
if (!p->rtpkeepalive)
r->rtpkeepalive = p->rtpkeepalive;

should be changed to:
r->rtptimeout = p->rtptimeout;
r->rtpholdtimeout = p->rtpholdtimeout;
r->rtpkeepalive = p->rtpkeepalive;

becouse p->rtptimeout is int
is always p->rtptimeout >= 0
and is properly initialized with global or local value

By: Kevin P. Fleming (kpfleming) 2005-05-19 08:47:09

Yes, you are correct, I've made those changes in CVS HEAD as well.

By: Digium Subversion (svnbot) 2008-01-15 15:35:35.000-0600

Repository: asterisk
Revision: 5734

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r5734 | kpfleming | 2008-01-15 15:35:35 -0600 (Tue, 15 Jan 2008) | 2 lines

ensure that peer-level RTP settings are actually used (bug ASTERISK-4211)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5734

By: Digium Subversion (svnbot) 2008-01-15 15:35:36.000-0600

Repository: asterisk
Revision: 5735

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r5735 | kpfleming | 2008-01-15 15:35:35 -0600 (Tue, 15 Jan 2008) | 2 lines

remove unnecessary conditional logic (bug ASTERISK-4211, take two)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5735