Compare commits

...

24 Commits

Author SHA1 Message Date
Leif Madsen
b4f865dcf0 Importing release summary for 1.8.2.4 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.4@308525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21 19:39:25 +00:00
Leif Madsen
059faa9585 Update description in ChangeLog.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.4@308516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21 19:00:24 +00:00
Leif Madsen
7d0e6108fc Update .version and ChangeLog. Remove old summary files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.4@308511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21 18:44:32 +00:00
Leif Madsen
0b25627ed4 Merge changes related to AST-2011-002 and FAX-281.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.4@308508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21 18:34:57 +00:00
Leif Madsen
2c97e4ed54 Create Asterisk 1.8.2.4 from 1.8.2.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.4@308505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21 18:29:52 +00:00
Leif Madsen
1f02d394dc Update .version file... :(
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.3@304285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 21:24:31 +00:00
Leif Madsen
b5dca3ad6a Importing release summary for 1.8.2.3 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.3@304144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 17:02:50 +00:00
Leif Madsen
46f4f27726 Merge changes from 303907 into tag.
Reimplemented fax session reservation to reverse the ABI breakage
introduced in r297486.
Update the ChangeLog.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.3@304143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 16:56:10 +00:00
Leif Madsen
e2fed2ce1a Remove current summary files in preparation to
update them.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.3@304142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 16:54:14 +00:00
Leif Madsen
86a85fe3f9 Create 1.8.2.3 tag from 1.8.2.2.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.3@304141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 16:51:37 +00:00
Leif Madsen
bfb60cb91d Importing release summary for 1.8.2.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.2@303105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-20 19:52:15 +00:00
Leif Madsen
55bb7d37cb Merge changes and update .version and ChangeLog files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.2@303104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-20 19:47:11 +00:00
Leif Madsen
47a66361f0 Create 1.8.2.2 from 1.8.2.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.2@303103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-20 19:26:54 +00:00
Leif Madsen
114259e2c2 Importing release summary for 1.8.2.1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.1@302160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-17 19:27:52 +00:00
Leif Madsen
dc6b5d1841 AST-2011-001
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.1@302150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-17 18:59:23 +00:00
Leif Madsen
33d563bbbc Create 1.8.2.1 from 1.8.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2.1@302106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-17 18:21:22 +00:00
Leif Madsen
f9d7cc227a Importing release summary for 1.8.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2@301499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 17:44:01 +00:00
Leif Madsen
830a38b230 Update ChangeLog, .version file, and remove summary files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2@301495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 17:04:33 +00:00
Leif Madsen
00ca758ff7 ------------------------------------------------------------------------
r301221 | pabelanger | 2011-01-09 15:40:35 -0600 (Sun, 09 Jan 2011) | 21 lines

Merged revisions 301220 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 [^]

........
  r301220 | pabelanger | 2011-01-09 16:38:24 -0500 (Sun, 09 Jan 2011) | 14 lines
  
  SOUND_CACHE_DIR now defaults to empty
  
  Sounds files included in the Asterisk tarball were being ignored and
  re-downloaded. Users wanting to cache the files can still override the setting
  using the --with-sounds-cache option.
  
  (closes issue 0018589)
  Reported by: pabelanger
  Patches:
        issue18589.patch uploaded by pabelanger (license 224)
        Tested by: pabelanger
  
  Review: https://reviewboard.asterisk.org/r/1074/ [^]
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2@301494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 16:52:31 +00:00
Leif Madsen
ef8953ed4c Create Asterisk 1.8.2 from 1.8.2-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2@301456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 16:18:54 +00:00
Leif Madsen
2dae3bd1ca Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2-rc1@298191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 16:26:29 +00:00
Leif Madsen
0c189f2a78 Importing release summary for 1.8.2-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2-rc1@298190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 16:26:24 +00:00
Leif Madsen
581f87b14e Importing files for 1.8.2-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2-rc1@298189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 16:26:20 +00:00
Leif Madsen
1793244b6f Creating tag for the release of asterisk-1.8.2-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.2-rc1@298188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 16:24:45 +00:00
13 changed files with 60381 additions and 7826 deletions

3
.lastclean Normal file
View File

@@ -0,0 +1,3 @@
38

1
.version Normal file
View File

@@ -0,0 +1 @@
1.8.2.4

27039
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
<!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.8.2.4</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.8.2.4</h3>
<h3 align="center">Date: 2011-02-21</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-2011-002.html">AST-2011-002</a></p>
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.8.2.3.</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>
4 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.8.2.4?view=revision&revision=308505">308505</a></td><td>lmadsen</td><td>Create Asterisk 1.8.2.4 from 1.8.2.3</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.2.4?view=revision&revision=308508">308508</a></td><td>lmadsen</td><td>Merge changes related to AST-2011-002 and FAX-281.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.2.4?view=revision&revision=308511">308511</a></td><td>lmadsen</td><td>Update .version and ChangeLog. Remove old summary files.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.2.4?view=revision&revision=308516">308516</a></td><td>lmadsen</td><td>Update description in 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 | 7 +++
asterisk-1.8.2.3-summary.html | 61 ---------------------------
asterisk-1.8.2.3-summary.txt | 93 ------------------------------------------
main/udptl.c | 48 +++++++++------------
5 files changed, 29 insertions(+), 182 deletions(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,98 @@
Release Summary
asterisk-1.8.2.4
Date: 2011-02-21
<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-2011-002
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.8.2.3.
----------------------------------------------------------------------
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
4 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 |
|----------+---------+-------------------------------+-------------------|
| 308505 | lmadsen | Create Asterisk 1.8.2.4 from | |
| | | 1.8.2.3 | |
|----------+---------+-------------------------------+-------------------|
| 308508 | lmadsen | Merge changes related to | |
| | | AST-2011-002 and FAX-281. | |
|----------+---------+-------------------------------+-------------------|
| | | Update .version and | |
| 308511 | lmadsen | ChangeLog. Remove old summary | |
| | | files. | |
|----------+---------+-------------------------------+-------------------|
| 308516 | lmadsen | Update description in | |
| | | 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 | 7 +++
asterisk-1.8.2.3-summary.html | 61 ---------------------------
asterisk-1.8.2.3-summary.txt | 93 ------------------------------------------
main/udptl.c | 48 +++++++++------------
5 files changed, 29 insertions(+), 182 deletions(-)
----------------------------------------------------------------------

View File

@@ -54,7 +54,7 @@ AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH], [use $3 in PATH]),
;;
esac
],
[m4_ifval($4, [$2="$4"])])
[m4_ifval($4, [$2="$4"], [:])])
AC_SUBST($2)
])

40786
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -431,7 +431,7 @@ AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [${HOME}/.asterisk_sounds_cache])
AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])

View File

@@ -813,16 +813,16 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
/* Define to 1 if `st_blksize' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
/* Define to 1 if `cr_uid' is member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_CR_UID
/* Define to 1 if `uid' is a member of `struct ucred'. */
/* Define to 1 if `uid' is member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_UID
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1097,12 +1097,12 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if the C compiler supports function prototypes. */
#undef PROTOTYPES
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
@@ -1122,6 +1122,11 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
/* Define to 1 if the `setvbuf' function takes the buffering type as its
second argument and the buffer pointer as the third, as on System V before
release 3. */
#undef SETVBUF_REVERSED
/* The size of `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
@@ -1157,27 +1162,12 @@
/* Define to a type of the same size as fd_set.fds_bits[[0]] */
#undef TYPEOF_FD_SET_FDS_BITS
/* Enable extensions on AIX 3, Interix. */
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define to 1 if running on Darwin. */
#undef _DARWIN_UNLIMITED_SELECT
@@ -1185,6 +1175,11 @@
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#undef _LARGEFILE_SOURCE
@@ -1201,6 +1196,20 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

View File

@@ -58,10 +58,8 @@ enum ast_fax_modems {
/*! \brief current state of a fax session */
enum ast_fax_state {
/*! reserved state */
AST_FAX_STATE_RESERVED = 0,
/*! uninitialized state */
AST_FAX_STATE_UNINITIALIZED,
AST_FAX_STATE_UNINITIALIZED = 0,
/*! initialized state */
AST_FAX_STATE_INITIALIZED,
/*! fax resources open state */
@@ -70,6 +68,10 @@ enum ast_fax_state {
AST_FAX_STATE_ACTIVE,
/*! fax session complete */
AST_FAX_STATE_COMPLETE,
/*! reserved state */
AST_FAX_STATE_RESERVED,
/*! inactive state */
AST_FAX_STATE_INACTIVE,
};
/*! \brief fax session options */
@@ -186,8 +188,6 @@ struct ast_fax_session {
unsigned long frames_sent;
/*! the fax technology callbacks */
const struct ast_fax_tech *tech;
/*! the token used to reserve this session */
struct ast_fax_tech_token *token;
/*! private implementation pointer */
void *tech_pvt;
/*! fax state */
@@ -202,10 +202,6 @@ struct ast_fax_session {
struct ast_fax_debug_info *debug_info;
/*! used to take variable-sized frames in and output frames of an expected size to the fax stack */
struct ast_smoother *smoother;
/*! some flags to track the stat counters for this session */
unsigned int reserved:1;
unsigned int active:1;
};
/*! \brief used to register a FAX technology module with res_fax */
@@ -250,14 +246,6 @@ struct ast_fax_tech {
char * (* const cli_show_settings)(int);
};
/*! \brief used by res_fax to reserve a FAX session */
struct ast_fax_tech_token {
/*! the fax technology callbacks */
const struct ast_fax_tech *tech;
/*! private implementation pointer */
void *tech_pvt;
};
/*! \brief register a fax technology */
int ast_fax_tech_register(struct ast_fax_tech *tech);

View File

@@ -218,38 +218,29 @@ static int decode_length(uint8_t *buf, unsigned int limit, unsigned int *len, un
}
*pvalue = (buf[*len] & 0x3F) << 14;
(*len)++;
/* Indicate we have a fragment */
/* We have a fragment. Currently we don't process fragments. */
ast_debug(1, "UDPTL packet with length greater than 16K received, decoding will fail\n");
return 1;
}
/*- End of function --------------------------------------------------------*/
static int decode_open_type(uint8_t *buf, unsigned int limit, unsigned int *len, const uint8_t **p_object, unsigned int *p_num_octets)
{
unsigned int octet_cnt;
unsigned int octet_idx;
unsigned int i;
int length; /* a negative length indicates the limit has been reached in decode_length. */
const uint8_t **pbuf;
unsigned int octet_cnt = 0;
for (octet_idx = 0, *p_num_octets = 0; ; octet_idx += octet_cnt) {
octet_cnt = 0;
if ((length = decode_length(buf, limit, len, &octet_cnt)) < 0)
if (decode_length(buf, limit, len, &octet_cnt) != 0)
return -1;
if (octet_cnt > 0) {
/* Make sure the buffer contains at least the number of bits requested */
if ((*len + octet_cnt) > limit)
return -1;
if (octet_cnt > 0) {
*p_num_octets += octet_cnt;
pbuf = &p_object[octet_idx];
i = 0;
/* Make sure the buffer contains at least the number of bits requested */
if ((*len + octet_cnt) > limit)
return -1;
*pbuf = &buf[*len];
*len += octet_cnt;
}
if (length == 0)
break;
*p_num_octets = octet_cnt;
*p_object = &buf[*len];
*len += octet_cnt;
}
return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -336,8 +327,8 @@ static int udptl_rx_packet(struct ast_udptl *s, uint8_t *buf, unsigned int len)
const uint8_t *data;
unsigned int ifp_len;
int repaired[16];
const uint8_t *bufs[16];
unsigned int lengths[16];
const uint8_t *bufs[ARRAY_LEN(s->f) - 1];
unsigned int lengths[ARRAY_LEN(s->f) - 1];
int span;
int entries;
int ifp_no;
@@ -367,13 +358,13 @@ static int udptl_rx_packet(struct ast_udptl *s, uint8_t *buf, unsigned int len)
do {
if ((stat2 = decode_length(buf, len, &ptr, &count)) < 0)
return -1;
for (i = 0; i < count; i++) {
for (i = 0; i < count && total_count + i < ARRAY_LEN(bufs); i++) {
if ((stat1 = decode_open_type(buf, len, &ptr, &bufs[total_count + i], &lengths[total_count + i])) != 0)
return -1;
}
total_count += count;
total_count += i;
}
while (stat2 > 0);
while (stat2 > 0 && total_count < ARRAY_LEN(bufs));
/* Step through in reverse order, so we go oldest to newest */
for (i = total_count; i > 0; i--) {
if (seq_no - i >= s->rx_seq_no) {
@@ -436,6 +427,9 @@ static int udptl_rx_packet(struct ast_udptl *s, uint8_t *buf, unsigned int len)
if (ptr + 1 > len)
return -1;
entries = buf[ptr++];
if (entries > MAX_FEC_ENTRIES) {
return -1;
}
s->rx[x].fec_entries = entries;
/* Decode the elements */

View File

@@ -383,33 +383,32 @@ static void base64_init(void)
char *ast_uri_encode(const char *string, char *outbuf, int buflen, int do_special_char)
{
const char *ptr = string; /* Start with the string */
char *out = NULL;
char *buf = NULL;
char *out = outbuf;
const char *mark = "-_.!~*'()"; /* no encode set, RFC 2396 section 2.3, RFC 3261 sec 25 */
ast_copy_string(outbuf, string, buflen);
while (*ptr) {
while (*ptr && out - outbuf < buflen - 1) {
if ((const signed char) *ptr < 32 || *ptr == 0x7f || *ptr == '%' ||
(do_special_char &&
!(*ptr >= '0' && *ptr <= '9') && /* num */
!(*ptr >= 'A' && *ptr <= 'Z') && /* ALPHA */
!(*ptr >= 'a' && *ptr <= 'z') && /* alpha */
!strchr(mark, *ptr))) { /* mark set */
/* Oops, we need to start working here */
if (!buf) {
buf = outbuf;
out = buf + (ptr - string) ; /* Set output ptr */
if (out - outbuf >= buflen - 3) {
break;
}
out += sprintf(out, "%%%02X", (unsigned char) *ptr);
} else if (buf) {
} else {
*out = *ptr; /* Continue copying the string */
out++;
}
ptr++;
}
if (buf)
if (buflen) {
*out = '\0';
}
return outbuf;
}

View File

@@ -638,6 +638,10 @@ const char *ast_fax_state_to_str(enum ast_fax_state state)
return "Active";
case AST_FAX_STATE_COMPLETE:
return "Complete";
case AST_FAX_STATE_RESERVED:
return "Reserved";
case AST_FAX_STATE_INACTIVE:
return "Inactive";
default:
ast_log(LOG_WARNING, "unhandled FAX state: %d\n", state);
return "Unknown";
@@ -678,16 +682,15 @@ static unsigned int fax_rate_str_to_int(const char *ratestr)
}
}
static void fax_session_release(struct ast_fax_session *s)
static void fax_session_release(struct ast_fax_session *s, struct ast_fax_tech_token *token)
{
if (s->token) {
s->tech->release_token(s->token);
s->token = NULL;
if (token) {
s->tech->release_token(token);
}
if (s->reserved) {
if (s->state == AST_FAX_STATE_RESERVED) {
ast_atomic_fetchadd_int(&faxregistry.reserved_sessions, -1);
s->reserved = 0;
s->state = AST_FAX_STATE_INACTIVE;
}
}
@@ -697,7 +700,7 @@ static void destroy_session(void *session)
struct ast_fax_session *s = session;
if (s->tech) {
fax_session_release(s);
fax_session_release(s, NULL);
if (s->tech_pvt) {
s->tech->destroy_session(s);
}
@@ -717,16 +720,15 @@ static void destroy_session(void *session)
ast_smoother_free(s->smoother);
}
if (s->active) {
if (s->state != AST_FAX_STATE_INACTIVE) {
ast_atomic_fetchadd_int(&faxregistry.active_sessions, -1);
s->active = 0;
}
ast_free(s->channame);
ast_free(s->chan_uniqueid);
}
static struct ast_fax_session *fax_session_reserve(struct ast_fax_session_details *details)
static struct ast_fax_session *fax_session_reserve(struct ast_fax_session_details *details, struct ast_fax_tech_token **token)
{
struct ast_fax_session *s;
struct fax_module *faxmod;
@@ -736,7 +738,7 @@ static struct ast_fax_session *fax_session_reserve(struct ast_fax_session_detail
return NULL;
}
s->state = AST_FAX_STATE_RESERVED;
s->state = AST_FAX_STATE_INACTIVE;
/* locate a FAX technology module that can handle said requirements
* Note: the requirements have not yet been finalized as T.38
@@ -764,19 +766,19 @@ static struct ast_fax_session *fax_session_reserve(struct ast_fax_session_detail
return s;
}
if (!(s->token = s->tech->reserve_session(s))) {
if (!(*token = s->tech->reserve_session(s))) {
ao2_ref(s, -1);
return NULL;
}
s->reserved = 1;
s->state = AST_FAX_STATE_RESERVED;
ast_atomic_fetchadd_int(&faxregistry.reserved_sessions, 1);
return s;
}
/*! \brief create a FAX session */
static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *details, struct ast_channel *chan, struct ast_fax_session *reserved)
static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *details, struct ast_channel *chan, struct ast_fax_session *reserved, struct ast_fax_tech_token *token)
{
struct ast_fax_session *s = NULL;
struct fax_module *faxmod;
@@ -786,9 +788,9 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
s = reserved;
ao2_ref(reserved, +1);
if (s->reserved) {
if (s->state == AST_FAX_STATE_RESERVED) {
ast_atomic_fetchadd_int(&faxregistry.reserved_sessions, -1);
s->reserved = 0;
s->state = AST_FAX_STATE_UNINITIALIZED;
}
}
@@ -796,18 +798,19 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
return NULL;
}
s->active = 1;
ast_atomic_fetchadd_int(&faxregistry.active_sessions, 1);
s->state = AST_FAX_STATE_UNINITIALIZED;
if (details->option.debug && (details->caps & AST_FAX_TECH_AUDIO)) {
if (!(s->debug_info = ast_calloc(1, sizeof(*(s->debug_info))))) {
fax_session_release(s, token);
ao2_ref(s, -1);
return NULL;
}
if (!(s->debug_info->dsp = ast_dsp_new())) {
ast_free(s->debug_info);
s->debug_info = NULL;
fax_session_release(s, token);
ao2_ref(s, -1);
return NULL;
}
@@ -815,11 +818,13 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
}
if (!(s->channame = ast_strdup(chan->name))) {
fax_session_release(s, token);
ao2_ref(s, -1);
return NULL;
}
if (!(s->chan_uniqueid = ast_strdup(chan->uniqueid))) {
fax_session_release(s, token);
ao2_ref(s, -1);
return NULL;
}
@@ -830,7 +835,7 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
details->id = s->id = ast_atomic_fetchadd_int(&faxregistry.nextsessionname, 1);
if (!s->tech) {
if (!token) {
/* locate a FAX technology module that can handle said requirements */
AST_RWLIST_RDLOCK(&faxmodules);
AST_RWLIST_TRAVERSE(&faxmodules, faxmod, list) {
@@ -851,7 +856,7 @@ static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *d
}
}
if (!(s->tech_pvt = s->tech->new_session(s, s->token))) {
if (!(s->tech_pvt = s->tech->new_session(s, token))) {
ast_log(LOG_ERROR, "FAX session failed to initialize.\n");
ao2_ref(s, -1);
return NULL;
@@ -1116,7 +1121,7 @@ static struct ast_control_t38_parameters our_t38_parameters = {
};
/*! \brief this is the generic FAX session handling function */
static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_details *details, struct ast_fax_session *reserved)
static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_details *details, struct ast_fax_session *reserved, struct ast_fax_tech_token *token)
{
int ms;
int timeout = RES_FAX_TIMEOUT;
@@ -1134,7 +1139,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det
chancount = 1;
/* create the FAX session */
if (!(fax = fax_session_new(details, chan, reserved))) {
if (!(fax = fax_session_new(details, chan, reserved, token))) {
ast_log(LOG_ERROR, "Can't create a FAX session, FAX attempt failed.\n");
report_fax_status(chan, details, "No Available Resource");
return -1;
@@ -1533,6 +1538,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
int channel_alive;
struct ast_fax_session_details *details;
struct ast_fax_session *s;
struct ast_fax_tech_token *token = NULL;
struct ast_fax_document *doc;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(filename);
@@ -1676,7 +1682,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;
}
if (!(s = fax_session_reserve(details))) {
if (!(s = fax_session_reserve(details, &token))) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
ast_string_field_set(details, resultstr, "error reserving fax session");
set_channel_variables(chan, details);
@@ -1692,6 +1698,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, resultstr, "error answering channel");
set_channel_variables(chan, details);
ast_log(LOG_WARNING, "Channel '%s' failed answer attempt.\n", chan->name);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
return -1;
@@ -1703,6 +1710,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "T38_NEG_ERROR");
ast_string_field_set(details, resultstr, "error negotiating T.38");
set_channel_variables(chan, details);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
return -1;
@@ -1714,6 +1722,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "T38_NEG_ERROR");
ast_string_field_set(details, resultstr, "error negotiating T.38");
set_channel_variables(chan, details);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
ast_log(LOG_ERROR, "error initializing channel '%s' in T.38 mode\n", chan->name);
@@ -1723,7 +1732,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
details->option.send_ced = 1;
}
if ((channel_alive = generic_fax_exec(chan, details, s)) < 0) {
if ((channel_alive = generic_fax_exec(chan, details, s, token)) < 0) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
}
@@ -2000,6 +2009,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
int channel_alive, file_count;
struct ast_fax_session_details *details;
struct ast_fax_session *s;
struct ast_fax_tech_token *token = NULL;
struct ast_fax_document *doc;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(filenames);
@@ -2167,7 +2177,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
details->option.request_t38 = AST_FAX_OPTFLAG_TRUE;
}
if (!(s = fax_session_reserve(details))) {
if (!(s = fax_session_reserve(details, &token))) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
ast_string_field_set(details, resultstr, "error reserving fax session");
set_channel_variables(chan, details);
@@ -2183,6 +2193,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, resultstr, "error answering channel");
set_channel_variables(chan, details);
ast_log(LOG_WARNING, "Channel '%s' failed answer attempt.\n", chan->name);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
return -1;
@@ -2194,6 +2205,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "T38_NEG_ERROR");
ast_string_field_set(details, resultstr, "error negotiating T.38");
set_channel_variables(chan, details);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
return -1;
@@ -2205,6 +2217,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
ast_string_field_set(details, error, "T38_NEG_ERROR");
ast_string_field_set(details, resultstr, "error negotiating T.38");
set_channel_variables(chan, details);
fax_session_release(s, token);
ao2_ref(s, -1);
ao2_ref(details, -1);
ast_log(LOG_ERROR, "error initializing channel '%s' in T.38 mode\n", chan->name);
@@ -2214,7 +2227,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
details->option.send_cng = 1;
}
if ((channel_alive = generic_fax_exec(chan, details, s)) < 0) {
if ((channel_alive = generic_fax_exec(chan, details, s, token)) < 0) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
}