Compare commits

...

19 Commits

Author SHA1 Message Date
Leif Madsen
b46e345f55 Importing release summary for 1.6.2.5 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.5@248857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 20:15:54 +00:00
Leif Madsen
fa0013c081 Update .version and ChangeLog.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.5@248852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 19:42:50 +00:00
Mark Michelson
5a42e11e93 Fix error where "/0" CIDR notation could be unpredictable.
AST-2010-003



git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.5@248849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 19:41:23 +00:00
Leif Madsen
e5d13da083 Create Asterisk 1.6.2.5 from 1.6.2.4.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.5@248846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 19:31:59 +00:00
Leif Madsen
6e87c02feb Importing release summary for 1.6.2.4 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.4@247694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 20:24:38 +00:00
Leif Madsen
dcc5bb0c9c Update .version and ChangeLog.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.4@247605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 18:01:35 +00:00
Leif Madsen
565f089425 Merge documentation from 1.6.2 branch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.4@247604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 17:57:02 +00:00
Leif Madsen
e9c0909eff Create 1.6.2.4 from 1.6.2.2.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.4@247601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 17:50:03 +00:00
Leif Madsen
75cd8fecff Importing release summary for 1.6.2.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.2@244390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 20:08:50 +00:00
David Vossel
4b83585d41 Fixes T38 crash with invalid FaxMaxDatagram sdp field
AST-2010-001


git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.2@244387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 19:58:14 +00:00
Leif Madsen
741d6732e4 ChangeLog and .version file updates.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.2@244382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 19:40:45 +00:00
Leif Madsen
c832097ce3 Create 1.6.2.2 from 1.6.2.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.2@244375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 19:26:37 +00:00
Leif Madsen
0e21660263 Importing release summary for 1.6.2.1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1@240135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 17:07:59 +00:00
Leif Madsen
307759ab1b Update .version and ChangeLog. Remove summary files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1@240128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 16:51:32 +00:00
Leif Madsen
0ea3d7900e Create Asterisk 1.6.2.1 release from 1.6.2.1-rc1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1@240124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 16:46:00 +00:00
Leif Madsen
96ab551dff Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1-rc1@238579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 13:48:34 +00:00
Leif Madsen
3d71586d7b Importing release summary for 1.6.2.1-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1-rc1@238578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 13:48:30 +00:00
Leif Madsen
4e9b6295b2 Importing files for 1.6.2.1-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1-rc1@238577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 13:48:24 +00:00
Leif Madsen
454ab2d682 Creating tag for the release of asterisk-1.6.2.1-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.2.1-rc1@238576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 13:47:24 +00:00
14 changed files with 22480 additions and 42 deletions

1
.lastclean Normal file
View File

@@ -0,0 +1 @@
36

1
.version Normal file
View File

@@ -0,0 +1 @@
1.6.2.5

21599
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,295 @@
==================
| Best Practices |
==================
The purpose of this document is to define best practices when working with
Asterisk in order to minimize possible security breaches and to provide tried
examples in field deployments. This is a living document and is subject to
change over time as best practices are defined.
--------
Sections
--------
* Filtering Data:
How to protect yourself from redial attacks
* Proper Device Naming:
Why to not use numbered extensions for devices
* Secure Passwords:
Secure passwords limit your risk to brute force attacks
* Reducing Pattern Match Typos:
Using the 'same' prefix, or using Goto()
----------------
Additional Links
----------------
Additional links that contain useful information about best practices or
security are listed below.
* Seven Steps to Better SIP Security:
http://blogs.digium.com/2009/03/28/sip-security/
* Asterisk VoIP Security (webinar):
http://www.asterisk.org/security/webinar/
==============
Filtering Data
==============
In the Asterisk dialplan, several channel variables contain data potentially
supplied by outside sources. This could lead to a potential security concern
where those outside sources may send cleverly crafted strings of data which
could be utilized, e.g. to place calls to unexpected locations.
An example of this can be found in the use of pattern matching and the ${EXTEN}
channel variable. Note that ${EXTEN} is not the only system created channel
variable, so it is important to be aware of where the data you're using is
coming from.
For example, this common dialplan takes 2 or more characters of data, starting
with a number 0-9, and then accepts any additional information supplied by the
request.
[NOTE: We use SIP in this example, but is not limited to SIP only; protocols
such as Jabber/XMPP or IAX2 are also susceptible to the same sort of
injection problem.]
[incoming]
exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
exten => _X.,n,Dial(SIP/${EXTEN})
exten => _X.,n,Hangup()
This dialplan may be utilized to accept calls to extensions, which then dial a
numbered device name configured in one of the channel configuration files (such
as sip.conf, iax.conf, etc...) (see the section Proper Device Naming for more
information on why this approach is flawed).
The example we've given above looks harmless enough until you take into
consideration that several channel technologies accept characters that could
be utilized in a clever attack. For example, instead of just sending a request
to dial extension 500 (which in our example above would create the string
SIP/500 and is then used by the Dial() application to place a call), someone
could potentially send a string like "500&SIP/itsp/14165551212".
The string "500&SIP/itsp/14165551212" would then be contained within the
${EXTEN} channel variable, which is then utilized by the Dial() application in
our example, thereby giving you the dialplan line of:
exten => _X.,n,Dial(SIP/500&SIP/itsp/14165551212)
Our example above has now provided someone with a method to place calls out of
your ITSP in a place where you didn't expect to allow it. There are a couple of
ways in which you can mitigate this impact: stricter pattern matching, or using
the FILTER() dialplan function.
Strict Pattern Matching
-----------------------
The simple way to mitigate this problem is with a strict pattern match that does
not utilize the period (.) or bang (!) characters to match on one-or-more
characters or zero-or-more characters (respectively). To fine tune our example
to only accept three digit extensions, we could change our pattern match to
be:
exten => _XXX,n,Dial(SIP/${EXTEN})
In this way, we have minimized our impact because we're not allowing anything
other than the numbers zero through nine. But in some cases we really do need to
handle variable pattern matches, such as when dialing international numbers
or when we want to handle something like a SIP URI. In this case, we'll need to
utilize the FILTER() dialplan function.
Using FILTER()
--------------
The FILTER() dialplan function is used to filter strings by only allowing
characters that you have specified. This is a perfect candidate for controlling
which characters you want to pass to the Dial() application, or any other
application which will contain dynamic information passed to Asterisk from an
external source. Lets take a look at how we can use FILTER() to control what
data we allow.
Using our previous example to accept any string length of 2 or more characters,
starting with a number of zero through nine, we can use FILTER() to limit what
we will accept to just numbers. Our example would then change to something like:
[incoming]
exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
exten => _X.,n,Dial(SIP/${FILTER(0-9,${EXTEN})})
exten => _X.,n,Hangup()
Note how we've wrapped the ${EXTEN} channel variable with the FILTER() function
which will then only pass back characters that fit into the numerical range that
we've defined.
Alternatively, if we didn't want to utilize the FILTER() function within the
Dial() application directly, we could save the value to a channel variable,
which has a side effect of being usable in other locations of your dialplan if
necessary, and to handle error checking in a separate location.
[incoming]
exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0-9,${EXTEN})})
exten => _X.,n,Dial(SIP/${SAFE_EXTEN})
exten => _X.,n,Hangup()
Now we can use the ${SAFE_EXTEN} channel variable anywhere throughout the rest
of our dialplan, knowing we've already filtered it. We could also perform an
error check to verify that what we've received in ${EXTEN} also matches the data
passed back by FILTER(), and to fail the call if things do not match.
[incoming]
exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0-9,${EXTEN})})
exten => _X.,n,GotoIf($[${EXTEN} != ${SAFE_EXTEN}]?error,1)
exten => _X.,n,Dial(SIP/${SAFE_EXTEN})
exten => _X.,n,Hangup()
exten => error,1,Verbose(2,Values of EXTEN and SAFE_EXTEN did not match.)
exten => error,n,Verbose(2,EXTEN: "${EXTEN}" -- SAFE_EXTEN: "${SAFE_EXTEN}")
exten => error,n,Playback(silence/1&invalid)
exten => error,n,Hangup()
Another example would be using FILTER() to control the characters we accept when
we're expecting to get a SIP URI for dialing.
[incoming]
exten => _[0-9a-zA-Z].,1,Verbose(2,Incoming call to extension ${EXTEN})
exten => _[0-9a-zA-Z].,n,Dial(SIP/${FILTER(.@0-9a-zA-Z,${EXTEN})
exten => _[0-9a-zA-Z].,n,Hangup()
Of course the FILTER() function doesn't check the formatting of the incoming
request. There is also the REGEX() dialplan function which can be used to
determine if the string passed to it matches the regular expression you've
created, and to take proper action on whether it matches or not. The creation of
regular expressions is left as an exercise for the reader.
More information about the FILTER() and REGEX() dialplan functions can be found
by typing "core show function FILTER" and "core show function REGEX" from your
Asterisk console.
====================
Proper Device Naming
====================
In Asterisk, the concept of an extension number being tied to a specific device
does not exist. Asterisk is aware of devices it can call or receive calls from,
and how you define in your dialplan how to reach those devices is up to you.
Because it has become common practice to think of a specific device as having an
extension number associated with it, it only becomes natural to think about
naming your devices the same as the extension number you're providing it. But
by doing this, you're limiting the powerful concept of separating user from
extensions, and extensions from devices.
It can also be a security hazard to name your devices with a number, as this can
open you up to brute force attacks. Many of the current exploits deal with
device configurations which utilize a number, and even worse, a password that
matches the devices name. For example, take a look at this poorly created device
in sip.conf:
[1000]
type=friend
context=international_dialing
secret=1000
As implied by the context, we've permitted a device named 1000 with a password
of 1000 to place calls internationally. If your PBX system is accessible via
the internet, then your system will be vulnerable to expensive international
calls. Even if your system is not accessible via the internet, people within
your organization could get access to dialing rules you'd prefer to reserve only
for certain people.
A more secure example for the device would be to use something like the MAC
address of the device, along with a strong password (see the section Secure
Passwords). The following example would be more secure:
[0004f2040001]
type=friend
context=international_dialing
secret=aE3%B8*$jk^G
Then in your dialplan, you would reference the device via the MAC address of the
device (or if using the softphone, a MAC address of a network interface on the
computer).
Also note that you should NOT use this password, as it will likely be one of the
first ones added to the dictionary for brute force attacks.
================
Secure Passwords
================
Secure passwords are necessary in many (if not all) environments, and Asterisk
is certainly no exception, especially when it comes to expensive long distance
calls that could potentially cost your company hundreds or thousands of dollars
on an expensive monthly phone bill, with little to no recourse to fight the
charges.
Whenever you are positioned to add a password to your system, whether that is
for a device configuration, a database connection, or any other secure
connection, be sure to use a secure password. A good example of a secure
password would be something like:
aE3%B8*$jk^G
Our password also contains 12 characters with a mixture of upper and
lower case characters, numbers, and symbols. Because these passwords are likely
to only be entered once, or loaded via a configuration file, there is
no need to create simple passwords, even in testing. Some of the holes found in
production systems used for exploitations involve finding the one test extension
that contains a weak password that was forgotten prior to putting a system into
production.
Using a web search you can find several online password generators such as
http://www.strongpasswordgenerator.com or there are several scripts that can be
used to generate a strong password.
============================
Reducing Pattern Match Typos
============================
As of Asterisk 1.6.2, a new method for reducing the number of complex pattern
matches you need to enter, which can reduce typos in your dialplan, has been
implemented. Traditionally, a dialplan with a complex pattern match would look
something like:
exten => _[3-5]XXX,1,Verbose(Incoming call to ${EXTEN})
exten => _[3-5]XXX,n,Set(DEVICE=${DB(device/mac_address/${EXTEN})})
exten => _[3-5]XXX,n,Set(TECHNOLOGY=${DB(device/technology/${EXTEN})})
exten => _[3-5]XXX,n,GotoIf($[${ISNULL(${TECHNOLOGY})} | ${ISNULL(${DEVICE})}]?error,1)
exten => _[3-5]XXX,n,Dial(${TECHNOLOGY}/${DEVICE},${GLOBAL(TIMEOUT)})
exten => _[3-5]XXX,n,Set(vmFlag=${IF($[${DIALSTATUS} = BUSY]?b:u)})
exten => _[3-5]XXX,n,Voicemail(${EXTEN}@${GLOBAL(VOICEMAIL_CONTEXT)},${vmFlag})
exten => _[3-5]XXX,n,Hangup()
exten => error,1,Verbose(2,Unable to lookup technology or device for extension)
exten => error,n,Playback(silence/1&num-not-in-db)
exten => error,n,Hangup()
Of course there exists the possibility for a typo when retyping the pattern
match _[3-5]XXX which will match on extensions 3000 through 5999. We can
minimize this error by utilizing the same => prefix on all lines beyond the
first one. Our same dialplan with using same => would look like the following:
exten => _[3-5]XXX,1,Verbose(Incoming call to ${EXTEN})
same => n,Set(DEVICE=${DB(device/mac_address/${EXTEN})})
same => n,Set(TECHNOLOGY=${DB(device/technology/${EXTEN})})
same => n,GotoIf($[${ISNULL(${TECHNOLOGY})} | ${ISNULL(${DEVICE})}]?error,1)
same => n,Dial(${TECHNOLOGY}/${DEVICE},${GLOBAL(TIMEOUT)})
same => n,Set(vmFlag=${IF($[${DIALSTATUS} = BUSY]?b:u)})
same => n,Voicemail(${EXTEN}@${GLOBAL(VOICEMAIL_CONTEXT)},${vmFlag})
same => n,Hangup()
exten => error,1,Verbose(2,Unable to lookup technology or device for extension)
same => n,Playback(silence/1&num-not-in-db)
same => n,Hangup()

View File

@@ -0,0 +1,65 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.6.2.2</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.6.2.2</h3>
<h3 align="center">Date: 2010-02-02</h3>
<h3 align="center">&lt;asteriskteam@digium.com&gt;</h3>
<hr/>
<h2 align="center">Table of Contents</h2>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol>
<hr/>
<a name="summary"><h2 align="center">Summary</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2010-001.html">AST-2010-001</a></p>
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.6.2.1.</p>
<hr/>
<a name="contributors"><h2 align="center">Contributors</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
<table width="100%" border="0">
<tr>
<td width="33%"><h3>Coders</h3></td>
<td width="33%"><h3>Testers</h3></td>
<td width="33%"><h3>Reporters</h3></td>
</tr>
<tr valign="top">
<td>
2 lmadsen<br/>
1 dvossel<br/>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<hr/>
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
<table width="100%" border="1">
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.2?view=revision&revision=244375">244375</a></td><td>lmadsen</td><td>Create 1.6.2.2 from 1.6.2.1.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.2?view=revision&revision=244382">244382</a></td><td>lmadsen</td><td>ChangeLog and .version file updates.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.2?view=revision&revision=244387">244387</a></td><td>dvossel</td><td>Fixes T38 crash with invalid FaxMaxDatagram sdp field</td>
<td></td></tr></table>
<hr/>
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
<pre>
.version | 2
ChangeLog | 10
asterisk-1.6.2.1-summary.html | 525 -------------------------------------
asterisk-1.6.2.1-summary.txt | 588 ------------------------------------------
channels/chan_sip.c | 99 ++++---
include/asterisk/udptl.h | 16 +
main/udptl.c | 36 ++
7 files changed, 121 insertions(+), 1155 deletions(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,96 @@
Release Summary
asterisk-1.6.2.2
Date: 2010-02-02
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Other Changes
4. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
This release has been made to address one or more security vulnerabilities
that have been identified. A security advisory document has been published
for each vulnerability that includes additional information. Users of
versions of Asterisk that are affected are strongly encouraged to review
the advisories and determine what action they should take to protect their
systems from these issues.
Security Advisories: AST-2010-001
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.6.2.1.
----------------------------------------------------------------------
Contributors
[Back to Top]
This table lists the people who have submitted code, those that have
tested patches, as well as those that reported issues on the issue tracker
that were resolved in this release. For coders, the number is how many of
their patches (of any size) were committed into this release. For testers,
the number is the number of times their name was listed as assisting with
testing a patch. Finally, for reporters, the number is the number of
issues that they reported that were closed by commits that went into this
release.
Coders Testers Reporters
2 lmadsen
1 dvossel
----------------------------------------------------------------------
Commits Not Associated with an Issue
[Back to Top]
This is a list of all changes that went into this release that did not
directly close an issue from the issue tracker. The commits may have been
marked as being related to an issue. If that is the case, the issue
numbers are listed here, as well.
+------------------------------------------------------------------------+
| Revision | Author | Summary | Issues Referenced |
|----------+---------+-------------------------------+-------------------|
| 244375 | lmadsen | Create 1.6.2.2 from 1.6.2.1. | |
|----------+---------+-------------------------------+-------------------|
| 244382 | lmadsen | ChangeLog and .version file | |
| | | updates. | |
|----------+---------+-------------------------------+-------------------|
| 244387 | dvossel | Fixes T38 crash with invalid | |
| | | FaxMaxDatagram sdp field | |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
Diffstat Results
[Back to Top]
This is a summary of the changes to the source code that went into this
release that was generated using the diffstat utility.
.version | 2
ChangeLog | 10
asterisk-1.6.2.1-summary.html | 525 -------------------------------------
asterisk-1.6.2.1-summary.txt | 588 ------------------------------------------
channels/chan_sip.c | 99 ++++---
include/asterisk/udptl.h | 16 +
main/udptl.c | 36 ++
7 files changed, 121 insertions(+), 1155 deletions(-)
----------------------------------------------------------------------

View File

@@ -0,0 +1,60 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.6.2.4</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.6.2.4</h3>
<h3 align="center">Date: 2010-02-18</h3>
<h3 align="center">&lt;asteriskteam@digium.com&gt;</h3>
<hr/>
<h2 align="center">Table of Contents</h2>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol>
<hr/>
<a name="summary"><h2 align="center">Summary</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2010-002.html">AST-2010-002</a></p>
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.6.2.2.</p>
<hr/>
<a name="contributors"><h2 align="center">Contributors</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
<table width="100%" border="0">
<tr>
<td width="33%"><h3>Coders</h3></td>
<td width="33%"><h3>Testers</h3></td>
<td width="33%"><h3>Reporters</h3></td>
</tr>
<tr valign="top">
<td>
3 lmadsen<br/>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<hr/>
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
<table width="100%" border="1">
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.4?view=revision&revision=247601">247601</a></td><td>lmadsen</td><td>Create 1.6.2.4 from 1.6.2.2.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.4?view=revision&revision=247604">247604</a></td><td>lmadsen</td><td>Merge documentation from 1.6.2 branch.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.4?view=revision&revision=247605">247605</a></td><td>lmadsen</td><td>Update .version and ChangeLog.</td>
<td></td></tr></table>
<hr/>
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
<pre>
.version | 2
ChangeLog | 9 +
README-SERIOUSLY.bestpractices.txt | 295 +++++++++++++++++++++++++++++++++++++
3 files changed, 305 insertions(+), 1 deletion(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,91 @@
Release Summary
asterisk-1.6.2.4
Date: 2010-02-18
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Other Changes
4. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
This release has been made to address one or more security vulnerabilities
that have been identified. A security advisory document has been published
for each vulnerability that includes additional information. Users of
versions of Asterisk that are affected are strongly encouraged to review
the advisories and determine what action they should take to protect their
systems from these issues.
Security Advisories: AST-2010-002
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.6.2.2.
----------------------------------------------------------------------
Contributors
[Back to Top]
This table lists the people who have submitted code, those that have
tested patches, as well as those that reported issues on the issue tracker
that were resolved in this release. For coders, the number is how many of
their patches (of any size) were committed into this release. For testers,
the number is the number of times their name was listed as assisting with
testing a patch. Finally, for reporters, the number is the number of
issues that they reported that were closed by commits that went into this
release.
Coders Testers Reporters
3 lmadsen
----------------------------------------------------------------------
Commits Not Associated with an Issue
[Back to Top]
This is a list of all changes that went into this release that did not
directly close an issue from the issue tracker. The commits may have been
marked as being related to an issue. If that is the case, the issue
numbers are listed here, as well.
+------------------------------------------------------------------------+
| Revision | Author | Summary | Issues Referenced |
|----------+---------+-------------------------------+-------------------|
| 247601 | lmadsen | Create 1.6.2.4 from 1.6.2.2. | |
|----------+---------+-------------------------------+-------------------|
| 247604 | lmadsen | Merge documentation from | |
| | | 1.6.2 branch. | |
|----------+---------+-------------------------------+-------------------|
| 247605 | lmadsen | Update .version and | |
| | | ChangeLog. | |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
Diffstat Results
[Back to Top]
This is a summary of the changes to the source code that went into this
release that was generated using the diffstat utility.
.version | 2
ChangeLog | 9 +
README-SERIOUSLY.bestpractices.txt | 295 +++++++++++++++++++++++++++++++++++++
3 files changed, 305 insertions(+), 1 deletion(-)
----------------------------------------------------------------------

View File

@@ -0,0 +1,61 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.6.2.5</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.6.2.5</h3>
<h3 align="center">Date: 2010-02-25</h3>
<h3 align="center">&lt;asteriskteam@digium.com&gt;</h3>
<hr/>
<h2 align="center">Table of Contents</h2>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol>
<hr/>
<a name="summary"><h2 align="center">Summary</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2010-003.html">AST-2010-003</a></p>
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.6.2.4.</p>
<hr/>
<a name="contributors"><h2 align="center">Contributors</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
<table width="100%" border="0">
<tr>
<td width="33%"><h3>Coders</h3></td>
<td width="33%"><h3>Testers</h3></td>
<td width="33%"><h3>Reporters</h3></td>
</tr>
<tr valign="top">
<td>
2 lmadsen<br/>
1 mmichelson<br/>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<hr/>
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
<table width="100%" border="1">
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.5?view=revision&revision=248846">248846</a></td><td>lmadsen</td><td>Create Asterisk 1.6.2.5 from 1.6.2.4.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.5?view=revision&revision=248849">248849</a></td><td>mmichelson</td><td>Fix error where "/0" CIDR notation could be unpredictable.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.6.2.5?view=revision&revision=248852">248852</a></td><td>lmadsen</td><td>Update .version and ChangeLog.</td>
<td></td></tr></table>
<hr/>
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
<pre>
.version | 2 +-
ChangeLog | 12 ++++++++++++
main/acl.c | 9 ++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,93 @@
Release Summary
asterisk-1.6.2.5
Date: 2010-02-25
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Other Changes
4. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
This release has been made to address one or more security vulnerabilities
that have been identified. A security advisory document has been published
for each vulnerability that includes additional information. Users of
versions of Asterisk that are affected are strongly encouraged to review
the advisories and determine what action they should take to protect their
systems from these issues.
Security Advisories: AST-2010-003
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.6.2.4.
----------------------------------------------------------------------
Contributors
[Back to Top]
This table lists the people who have submitted code, those that have
tested patches, as well as those that reported issues on the issue tracker
that were resolved in this release. For coders, the number is how many of
their patches (of any size) were committed into this release. For testers,
the number is the number of times their name was listed as assisting with
testing a patch. Finally, for reporters, the number is the number of
issues that they reported that were closed by commits that went into this
release.
Coders Testers Reporters
2 lmadsen
1 mmichelson
----------------------------------------------------------------------
Commits Not Associated with an Issue
[Back to Top]
This is a list of all changes that went into this release that did not
directly close an issue from the issue tracker. The commits may have been
marked as being related to an issue. If that is the case, the issue
numbers are listed here, as well.
+------------------------------------------------------------------------+
| Revision | Author | Summary | Issues |
| | | | Referenced |
|----------+------------+-----------------------------------+------------|
| 248846 | lmadsen | Create Asterisk 1.6.2.5 from | |
| | | 1.6.2.4. | |
|----------+------------+-----------------------------------+------------|
| 248849 | mmichelson | Fix error where "/0" CIDR | |
| | | notation could be unpredictable. | |
|----------+------------+-----------------------------------+------------|
| 248852 | lmadsen | Update .version and ChangeLog. | |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
Diffstat Results
[Back to Top]
This is a summary of the changes to the source code that went into this
release that was generated using the diffstat utility.
.version | 2 +-
ChangeLog | 12 ++++++++++++
main/acl.c | 9 ++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------

View File

@@ -3893,7 +3893,7 @@ static enum sip_result __sip_reliable_xmit(struct sip_pvt *p, int seqno, int res
p->packets = pkt; /* Add it to the queue */
if (resp) {
/* Parse out the response code */
if (sscanf(ast_str_buffer(pkt->data), "SIP/2.0 %30d", &respid) == 1) {
if (sscanf(ast_str_buffer(pkt->data), "SIP/2.0 %30u", &respid) == 1) {
pkt->response_code = respid;
}
}
@@ -5033,20 +5033,30 @@ static void change_t38_state(struct sip_pvt *p, int state)
return;
/* Given the state requested and old state determine what control frame we want to queue up */
if (state == T38_PEER_REINVITE) {
switch (state) {
case T38_PEER_REINVITE:
parameters = p->t38.their_parms;
parameters.max_ifp = ast_udptl_get_far_max_ifp(p->udptl);
parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
ast_udptl_set_tag(p->udptl, "SIP/%s", p->username);
} else if (state == T38_ENABLED) {
break;
case T38_ENABLED:
parameters = p->t38.their_parms;
parameters.max_ifp = ast_udptl_get_far_max_ifp(p->udptl);
parameters.request_response = AST_T38_NEGOTIATED;
ast_udptl_set_tag(p->udptl, "SIP/%s", p->username);
} else if (state == T38_DISABLED && old == T38_ENABLED)
parameters.request_response = AST_T38_TERMINATED;
else if (state == T38_DISABLED && old == T38_LOCAL_REINVITE)
parameters.request_response = AST_T38_REFUSED;
break;
case T38_DISABLED:
if (old == T38_ENABLED) {
parameters.request_response = AST_T38_TERMINATED;
} else if (old == T38_LOCAL_REINVITE) {
parameters.request_response = AST_T38_REFUSED;
}
break;
case T38_LOCAL_REINVITE:
/* wait until we get a peer response before responding to local reinvite */
break;
}
/* Woot we got a message, create a control frame and send it on! */
if (parameters.request_response)
@@ -6412,10 +6422,21 @@ static int sip_transfer(struct ast_channel *ast, const char *dest)
/*! \brief Helper function which updates T.38 capability information and triggers a reinvite */
static void interpret_t38_parameters(struct sip_pvt *p, const struct ast_control_t38_parameters *parameters)
{
if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
return;
}
switch (parameters->request_response) {
case AST_T38_NEGOTIATED:
case AST_T38_REQUEST_NEGOTIATE: /* Request T38 */
if (p->t38.state == T38_PEER_REINVITE) {
/* Negotiation can not take place without a valid max_ifp value. */
if (!parameters->max_ifp) {
change_t38_state(p, T38_DISABLED);
if (p->t38.state == T38_PEER_REINVITE) {
AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
}
break;
} else if (p->t38.state == T38_PEER_REINVITE) {
AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
p->t38.our_parms = *parameters;
/* modify our parameters to conform to the peer's parameters,
@@ -6435,7 +6456,7 @@ static void interpret_t38_parameters(struct sip_pvt *p, const struct ast_control
ast_udptl_set_local_max_ifp(p->udptl, p->t38.our_parms.max_ifp);
change_t38_state(p, T38_ENABLED);
transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
} else if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && p->t38.state != T38_ENABLED) {
} else if (p->t38.state != T38_ENABLED) {
p->t38.our_parms = *parameters;
ast_udptl_set_local_max_ifp(p->udptl, p->t38.our_parms.max_ifp);
change_t38_state(p, T38_LOCAL_REINVITE);
@@ -7978,10 +7999,10 @@ static int get_ip_and_port_from_sdp(struct sip_request *req, const enum media_ty
}
/* We only want the m and c lines for audio */
for (m = get_sdp_iterate(&miterator, req, "m"); !ast_strlen_zero(m); m = get_sdp_iterate(&miterator, req, "m")) {
if ((media == SDP_AUDIO && ((sscanf(m, "audio %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "audio %30d RTP/AVP %n", &x, &len) == 1 && len > 0))) ||
(media == SDP_VIDEO && ((sscanf(m, "video %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "video %30d RTP/AVP %n", &x, &len) == 1 && len > 0)))) {
if ((media == SDP_AUDIO && ((sscanf(m, "audio %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "audio %30u RTP/AVP %n", &x, &len) == 1 && len > 0))) ||
(media == SDP_VIDEO && ((sscanf(m, "video %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "video %30u RTP/AVP %n", &x, &len) == 1 && len > 0)))) {
/* See if there's a c= line for this media stream.
* XXX There is no guarantee that we'll be grabbing the c= line for this
* particular media stream here. However, this is the same logic used in process_sdp.
@@ -8191,8 +8212,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
nextm = get_sdp_iterate(&next, req, "m");
/* Search for audio media definition */
if ((sscanf(m, "audio %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "audio %30d RTP/AVP %n", &x, &len) == 1 && len > 0)) {
if ((sscanf(m, "audio %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "audio %30u RTP/AVP %n", &x, &len) == 1 && len > 0)) {
audio = TRUE;
p->offered_media[SDP_AUDIO].offered = TRUE;
numberofmediastreams++;
@@ -8202,7 +8223,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
codecs = m + len;
ast_copy_string(p->offered_media[SDP_AUDIO].text, codecs, sizeof(p->offered_media[SDP_AUDIO].text));
for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
if (sscanf(codecs, "%30d%n", &codec, &len) != 1) {
if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
return -1;
}
@@ -8212,8 +8233,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_rtp_set_m_type(newaudiortp, codec);
}
/* Search for video media definition */
} else if ((sscanf(m, "video %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "video %30d RTP/AVP %n", &x, &len) == 1 && len >= 0)) {
} else if ((sscanf(m, "video %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "video %30u RTP/AVP %n", &x, &len) == 1 && len >= 0)) {
video = TRUE;
p->novideo = FALSE;
p->offered_media[SDP_VIDEO].offered = TRUE;
@@ -8224,7 +8245,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
codecs = m + len;
ast_copy_string(p->offered_media[SDP_VIDEO].text, codecs, sizeof(p->offered_media[SDP_VIDEO].text));
for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
if (sscanf(codecs, "%30d%n", &codec, &len) != 1) {
if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
return -1;
}
@@ -8233,8 +8254,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_rtp_set_m_type(newvideortp, codec);
}
/* Search for text media definition */
} else if ((sscanf(m, "text %30d/%30d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "text %30d RTP/AVP %n", &x, &len) == 1 && len > 0)) {
} else if ((sscanf(m, "text %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
(sscanf(m, "text %30u RTP/AVP %n", &x, &len) == 1 && len > 0)) {
text = TRUE;
p->notext = FALSE;
p->offered_media[SDP_TEXT].offered = TRUE;
@@ -8245,7 +8266,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
codecs = m + len;
ast_copy_string(p->offered_media[SDP_TEXT].text, codecs, sizeof(p->offered_media[SDP_TEXT].text));
for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
if (sscanf(codecs, "%30d%n", &codec, &len) != 1) {
if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
return -1;
}
@@ -8254,8 +8275,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_rtp_set_m_type(newtextrtp, codec);
}
/* Search for image media definition */
} else if (p->udptl && ((sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) ||
(sscanf(m, "image %30d UDPTL t38%n", &x, &len) == 1 && len > 0) )) {
} else if (p->udptl && ((sscanf(m, "image %30u udptl t38%n", &x, &len) == 1 && len > 0) ||
(sscanf(m, "image %30u UDPTL t38%n", &x, &len) == 1 && len > 0) )) {
image = TRUE;
if (debug)
ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid);
@@ -8492,6 +8513,12 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
if (debug)
ast_debug(1,"Peer T.38 UDPTL is at port %s:%d\n", ast_inet_ntoa(isin.sin_addr), ntohs(isin.sin_port));
/* verify the far max ifp can be calculated. this requires far max datagram to be set. */
if (!ast_udptl_get_far_max_datagram(p->udptl)) {
/* setting to zero will force a default if none was provided by the SDP */
ast_udptl_set_far_max_datagram(p->udptl, 0);
}
/* Remote party offers T38, we need to update state */
if ((t38action == SDP_T38_ACCEPT) &&
(p->t38.state == T38_LOCAL_REINVITE)) {
@@ -8875,12 +8902,12 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p)
{
int found = FALSE;
char s[256];
int x;
unsigned int x;
if ((sscanf(a, "T38FaxMaxBuffer:%30d", &x) == 1)) {
if ((sscanf(a, "T38FaxMaxBuffer:%30u", &x) == 1)) {
ast_debug(3, "MaxBufferSize:%d\n", x);
found = TRUE;
} else if ((sscanf(a, "T38MaxBitRate:%30d", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%30d", &x) == 1)) {
} else if ((sscanf(a, "T38MaxBitRate:%30u", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%30u", &x) == 1)) {
ast_debug(3, "T38MaxBitRate: %d\n", x);
switch (x) {
case 14400:
@@ -8903,21 +8930,21 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p)
break;
}
found = TRUE;
} else if ((sscanf(a, "T38FaxVersion:%30d", &x) == 1)) {
ast_debug(3, "FaxVersion: %d\n", x);
} else if ((sscanf(a, "T38FaxVersion:%30u", &x) == 1)) {
ast_debug(3, "FaxVersion: %u\n", x);
p->t38.their_parms.version = x;
found = TRUE;
} else if ((sscanf(a, "T38FaxMaxDatagram:%30d", &x) == 1) || (sscanf(a, "T38MaxDatagram:%30d", &x) == 1)) {
} else if ((sscanf(a, "T38FaxMaxDatagram:%30u", &x) == 1) || (sscanf(a, "T38MaxDatagram:%30u", &x) == 1)) {
/* override the supplied value if the configuration requests it */
if (p->t38_maxdatagram > x) {
ast_debug(1, "Overriding T38FaxMaxDatagram '%d' with '%d'\n", x, p->t38_maxdatagram);
x = p->t38_maxdatagram;
}
ast_debug(3, "FaxMaxDatagram: %d\n", x);
ast_debug(3, "FaxMaxDatagram: %u\n", x);
ast_udptl_set_far_max_datagram(p->udptl, x);
found = TRUE;
} else if ((strncmp(a, "T38FaxFillBitRemoval", 20) == 0)) {
if (sscanf(a, "T38FaxFillBitRemoval:%30d", &x) == 1) {
if (sscanf(a, "T38FaxFillBitRemoval:%30u", &x) == 1) {
ast_debug(3, "FillBitRemoval: %d\n", x);
if (x == 1) {
p->t38.their_parms.fill_bit_removal = TRUE;
@@ -8928,7 +8955,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p)
}
found = TRUE;
} else if ((strncmp(a, "T38FaxTranscodingMMR", 20) == 0)) {
if (sscanf(a, "T38FaxTranscodingMMR:%30d", &x) == 1) {
if (sscanf(a, "T38FaxTranscodingMMR:%30u", &x) == 1) {
ast_debug(3, "Transcoding MMR: %d\n", x);
if (x == 1) {
p->t38.their_parms.transcoding_mmr = TRUE;
@@ -8939,7 +8966,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p)
}
found = TRUE;
} else if ((strncmp(a, "T38FaxTranscodingJBIG", 21) == 0)) {
if (sscanf(a, "T38FaxTranscodingJBIG:%30d", &x) == 1) {
if (sscanf(a, "T38FaxTranscodingJBIG:%30u", &x) == 1) {
ast_debug(3, "Transcoding JBIG: %d\n", x);
if (x == 1) {
p->t38.their_parms.transcoding_jbig = TRUE;
@@ -10255,7 +10282,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
ast_str_append(&a_modem, 0, "a=T38FaxRateManagement:localTCF\r\n");
break;
}
ast_str_append(&a_modem, 0, "a=T38FaxMaxDatagram:%d\r\n", ast_udptl_get_local_max_datagram(p->udptl));
ast_str_append(&a_modem, 0, "a=T38FaxMaxDatagram:%u\r\n", ast_udptl_get_local_max_datagram(p->udptl));
switch (ast_udptl_get_error_correction_scheme(p->udptl)) {
case UDPTL_ERROR_CORRECTION_NONE:
break;
@@ -23209,7 +23236,7 @@ static int handle_t38_options(struct ast_flags *flags, struct ast_flags *mask, s
ast_clear_flag(&flags[1], SIP_PAGE2_T38SUPPORT);
ast_set_flag(&flags[1], SIP_PAGE2_T38SUPPORT_UDPTL);
} else if (!strncasecmp(word, "maxdatagram=", 12)) {
if (sscanf(&word[12], "%30d", maxdatagram) != 1) {
if (sscanf(&word[12], "%30u", maxdatagram) != 1) {
ast_log(LOG_WARNING, "Invalid maxdatagram '%s' at line %d of %s\n", v->value, v->lineno, config);
*maxdatagram = global_t38_maxdatagram;
}

View File

@@ -108,12 +108,28 @@ void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38
void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp);
/*!
* \brief retrieves local_max_datagram.
*
* \retval positive value representing max datagram size.
* \retval 0 if no value is present
*/
unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl);
/*!
* \brief sets far max datagram size. If max_datagram is = 0, the far max datagram
* size is set to a default value.
*/
void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram);
unsigned int ast_udptl_get_far_max_datagram(const struct ast_udptl *udptl);
/*!
* \brief retrieves far max ifp
*
* \retval positive value representing max ifp size
* \retval 0 if no value is present
*/
unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl);
void ast_udptl_setnat(struct ast_udptl *udptl, int nat);

View File

@@ -298,7 +298,14 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
if (!strchr(nm, '.')) {
if ((sscanf(nm, "%30d", &x) == 1) && (x >= 0) && (x <= 32)) {
ha->netmask.s_addr = htonl(0xFFFFFFFF << (32 - x));
if (x == 0) {
/* This is special-cased to prevent unpredictable
* behavior of shifting left 32 bits
*/
ha->netmask.s_addr = 0;
} else {
ha->netmask.s_addr = htonl(0xFFFFFFFF << (32 - x));
}
} else {
ast_log(LOG_WARNING, "Invalid CIDR in %s\n", stuff);
ast_free(ha);

View File

@@ -91,6 +91,8 @@ static int udptlfecspan;
static int use_even_ports;
#define LOCAL_FAX_MAX_DATAGRAM 1400
#define DEFAULT_FAX_MAX_DATAGRAM 400
#define FAX_MAX_DATAGRAM_LIMIT 1400
#define MAX_FEC_ENTRIES 5
#define MAX_FEC_SPAN 5
@@ -854,9 +856,13 @@ void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38
void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp)
{
udptl->local_max_ifp = max_ifp;
/* reset calculated values so they'll be computed again */
udptl->local_max_datagram = -1;
/* make sure max_ifp is a positive value since a cast will take place when
* when setting local_max_ifp */
if ((signed int) max_ifp > 0) {
udptl->local_max_ifp = max_ifp;
/* reset calculated values so they'll be computed again */
udptl->local_max_datagram = -1;
}
}
unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl)
@@ -864,18 +870,30 @@ unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl)
if (udptl->local_max_datagram == -1) {
calculate_local_max_datagram(udptl);
}
/* this function expects a unsigned value in return. */
if (udptl->local_max_datagram < 0) {
return 0;
}
return udptl->local_max_datagram;
}
void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram)
{
udptl->far_max_datagram = max_datagram;
if (!max_datagram || (max_datagram > FAX_MAX_DATAGRAM_LIMIT)) {
udptl->far_max_datagram = DEFAULT_FAX_MAX_DATAGRAM;
} else {
udptl->far_max_datagram = max_datagram;
}
/* reset calculated values so they'll be computed again */
udptl->far_max_ifp = -1;
}
unsigned int ast_udptl_get_far_max_datagram(const struct ast_udptl *udptl)
{
if (udptl->far_max_datagram < 0) {
return 0;
}
return udptl->far_max_datagram;
}
@@ -884,6 +902,10 @@ unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl)
if (udptl->far_max_ifp == -1) {
calculate_far_max_ifp(udptl);
}
if (udptl->far_max_ifp < 0) {
return 0;
}
return udptl->far_max_ifp;
}
@@ -1033,7 +1055,11 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f)
unsigned int seq;
unsigned int len = f->datalen;
int res;
uint8_t buf[s->far_max_datagram];
/* if no max datagram size is provided, use default value */
const int bufsize = (s->far_max_datagram > 0) ? s->far_max_datagram : DEFAULT_FAX_MAX_DATAGRAM;
uint8_t buf[bufsize];
memset(buf, 0, sizeof(buf));
/* If we have no peer, return immediately */
if (s->them.sin_addr.s_addr == INADDR_ANY)