mirror of
https://github.com/asterisk/asterisk.git
synced 2025-08-28 17:08:59 +00:00
Compare commits
39 Commits
1.8.15.0-r
...
1.8.8.1
Author | SHA1 | Date | |
---|---|---|---|
|
123e0be58d | ||
|
d835fd612b | ||
|
314974d41d | ||
|
6ee2daa7e1 | ||
|
5096deb5ba | ||
|
a226feca4b | ||
|
49c68fae76 | ||
|
232a6a3ecc | ||
|
2e5598ee53 | ||
|
1d88217b1c | ||
|
a1d9e318d6 | ||
|
da1b9545cd | ||
|
1babab8709 | ||
|
58e6bd903b | ||
|
7440355b51 | ||
|
e3a84a0f9f | ||
|
18b8e92152 | ||
|
6f379742e5 | ||
|
2b29d4fb1c | ||
|
ab580e59b0 | ||
|
c6316c14b6 | ||
|
d33c176ac0 | ||
|
d16dd9b445 | ||
|
2326a531c5 | ||
|
157d77adf3 | ||
|
5f2d403c24 | ||
|
c4dd975d08 | ||
|
f8cac0983a | ||
|
818a4c750f | ||
|
7d4af3053e | ||
|
d204fe57a2 | ||
|
f109eaf94e | ||
|
5bdc379707 | ||
|
41674ceeec | ||
|
8e24f689b6 | ||
|
2a45dd06e1 | ||
|
c62c6f8013 | ||
|
c18d646a9d | ||
|
47fe3c0da5 |
3
.lastclean
Normal file
3
.lastclean
Normal file
@@ -0,0 +1,3 @@
|
||||
39
|
||||
|
||||
|
12
CHANGES
12
CHANGES
@@ -8,6 +8,18 @@
|
||||
===
|
||||
======================================================================
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
--- Functionality changes since Asterisk 1.8.7.1 -----------------------------
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
SIP Changes
|
||||
-----------
|
||||
* Due to potential username discovery vulnerabilities, the 'nat' setting in sip.conf
|
||||
now defaults to force_rport. It is very important that phones requiring nat=no be
|
||||
specifically set as such instead of relying on the default setting. If at all
|
||||
possible, all devices should have nat settings configured in the general section as
|
||||
opposed to configuring nat per-device.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
--- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
|
||||
------------------------------------------------------------------------------
|
||||
|
100
asterisk-1.8.8.1-summary.html
Normal file
100
asterisk-1.8.8.1-summary.html
Normal file
@@ -0,0 +1,100 @@
|
||||
<!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.8.1</title></head>
|
||||
<body>
|
||||
<h1 align="center"><a name="top">Release Summary</a></h1>
|
||||
<h3 align="center">asterisk-1.8.8.1</h3>
|
||||
<h3 align="center">Date: 2011-12-30</h3>
|
||||
<h3 align="center"><asteriskteam@digium.com></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 includes only bug fixes. The changes included were made only to address problems that have been identified in this release series. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p>
|
||||
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.8.8.0.</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>
|
||||
7 rmudgett<br/>
|
||||
3 mjordan<br/>
|
||||
3 seanbright<br/>
|
||||
1 kmoore<br/>
|
||||
1 kpfleming<br/>
|
||||
1 twilson<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/branches/1.8?view=revision&revision=348310">348310</a></td><td>rmudgett</td><td>Fix ParkAndAnnounce to pass the CallerID to the announcing channel.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348362">348362</a></td><td>rmudgett</td><td>Fix crash during CDR update.</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18836">ASTERISK-18836</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348401">348401</a></td><td>rmudgett</td><td>Fix cut and past error in ast_call_forward().</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18836">ASTERISK-18836</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348464">348464</a></td><td>rmudgett</td><td>Clean-up on isle five for __ast_request_and_dial() and ast_call_forward().</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348516">348516</a></td><td>kpfleming</td><td>Correct two flaws in sip.conf.sample related to AST-2011-013.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348647">348647</a></td><td>rmudgett</td><td>Fix crashes on other platforms caused by interference from Darwin weak symbol support.</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18728">ASTERISK-18728</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348735">348735</a></td><td>rmudgett</td><td>Fix chan_iax2 to not report an RDNIS number if it is blank.</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-17152">ASTERISK-17152</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348833">348833</a></td><td>twilson</td><td>Allow packetization vaules > 127</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18876">ASTERISK-18876</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348888">348888</a></td><td>mjordan</td><td>Fix for memory leaks / cleanup in cel_pgsql</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18879">ASTERISK-18879</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348940">348940</a></td><td>rmudgett</td><td>Fix extension state callback references in chan_sip.</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-17760">ASTERISK-17760</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18844">ASTERISK-18844</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=348992">348992</a></td><td>kmoore</td><td>Fix missing doc tags found while fixing ASTERISK-18689</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18689">ASTERISK-18689</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=349044">349044</a></td><td>seanbright</td><td>In ChanSpy, don't create audiohooks that will never be used.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=349144">349144</a></td><td>seanbright</td><td>Once an audiohook is attached to a channel, we continue to transcode all of the</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=349194">349194</a></td><td>mjordan</td><td>Fix timing source dependency issues with MOH</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-17474">ASTERISK-17474</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=349289">349289</a></td><td>seanbright</td><td>Use ast_audiohook_write_list_empty to determine if our lists are empty instead</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=349339">349339</a></td><td>mjordan</td><td>Handle AST_CONTROL_UPDATE_RTP_PEER frames in local bridge loop</td>
|
||||
<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19040">ASTERISK-19040</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-19128">ASTERISK-19128</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-17725">ASTERISK-17725</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18340">ASTERISK-18340</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-19095">ASTERISK-19095</a></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>
|
||||
apps/app_authenticate.c | 15 +++-
|
||||
apps/app_chanspy.c | 56 +++++++++++-----
|
||||
apps/app_dial.c | 2
|
||||
apps/app_followme.c | 16 +++-
|
||||
apps/app_parkandannounce.c | 19 ++++-
|
||||
apps/app_queue.c | 2
|
||||
cel/cel_pgsql.c | 37 ++++-------
|
||||
channels/chan_iax2.c | 6 +
|
||||
channels/chan_sip.c | 28 +++++---
|
||||
configs/sip.conf.sample | 6 -
|
||||
configure.ac | 34 +++++++++-
|
||||
funcs/func_cdr.c | 20 ++++--
|
||||
include/asterisk/cdr.h | 32 +++++++--
|
||||
include/asterisk/frame.h | 2
|
||||
include/asterisk/module.h | 1
|
||||
include/asterisk/pbx.h | 42 +++++++++---
|
||||
main/audiohook.c | 4 +
|
||||
main/channel.c | 122 ++++++++++++++++++++++++------------
|
||||
main/features.c | 20 ++++--
|
||||
main/pbx.c | 150 ++++++++++++++++++++++++++++-----------------
|
||||
main/rtp_engine.c | 8 +-
|
||||
res/res_monitor.c | 6 +
|
||||
res/res_musiconhold.c | 21 ++++--
|
||||
res/res_timing_dahdi.c | 2
|
||||
res/res_timing_pthread.c | 2
|
||||
res/res_timing_timerfd.c | 2
|
||||
26 files changed, 452 insertions(+), 203 deletions(-)
|
||||
</pre><br/>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
166
asterisk-1.8.8.1-summary.txt
Normal file
166
asterisk-1.8.8.1-summary.txt
Normal file
@@ -0,0 +1,166 @@
|
||||
Release Summary
|
||||
|
||||
asterisk-1.8.8.1
|
||||
|
||||
Date: 2011-12-30
|
||||
|
||||
<asteriskteam@digium.com>
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Table of Contents
|
||||
|
||||
1. Summary
|
||||
2. Contributors
|
||||
3. Other Changes
|
||||
4. Diffstat
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Summary
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This release includes only bug fixes. The changes included were made only
|
||||
to address problems that have been identified in this release series.
|
||||
Users should be able to safely upgrade to this version if this release
|
||||
series is already in use. Users considering upgrading from a previous
|
||||
release series are strongly encouraged to review the UPGRADE.txt document
|
||||
as well as the CHANGES document for information about upgrading to this
|
||||
release series.
|
||||
|
||||
The data in this summary reflects changes that have been made since the
|
||||
previous release, asterisk-1.8.8.0.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
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
|
||||
7 rmudgett
|
||||
3 mjordan
|
||||
3 seanbright
|
||||
1 kmoore
|
||||
1 kpfleming
|
||||
1 twilson
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
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|
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Fix ParkAndAnnounce to pass the | |
|
||||
|348310 |rmudgett |CallerID to the announcing | |
|
||||
| | |channel. | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348362 |rmudgett |Fix crash during CDR update. |ASTERISK-18836 |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348401 |rmudgett |Fix cut and past error in |ASTERISK-18836 |
|
||||
| | |ast_call_forward(). | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Clean-up on isle five for | |
|
||||
|348464 |rmudgett |__ast_request_and_dial() and | |
|
||||
| | |ast_call_forward(). | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Correct two flaws in | |
|
||||
|348516 |kpfleming |sip.conf.sample related to | |
|
||||
| | |AST-2011-013. | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Fix crashes on other platforms | |
|
||||
|348647 |rmudgett |caused by interference from Darwin|ASTERISK-18728 |
|
||||
| | |weak symbol support. | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348735 |rmudgett |Fix chan_iax2 to not report an |ASTERISK-17152 |
|
||||
| | |RDNIS number if it is blank. | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348833 |twilson |Allow packetization vaules > 127 |ASTERISK-18876 |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348888 |mjordan |Fix for memory leaks / cleanup in |ASTERISK-18879 |
|
||||
| | |cel_pgsql | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348940 |rmudgett |Fix extension state callback |ASTERISK-17760, |
|
||||
| | |references in chan_sip. |ASTERISK-18844 |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|348992 |kmoore |Fix missing doc tags found while |ASTERISK-18689 |
|
||||
| | |fixing ASTERISK-18689 | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |In ChanSpy, don't create | |
|
||||
|349044 |seanbright|audiohooks that will never be | |
|
||||
| | |used. | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Once an audiohook is attached to a| |
|
||||
|349144 |seanbright|channel, we continue to transcode | |
|
||||
| | |all of the | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
|349194 |mjordan |Fix timing source dependency |ASTERISK-17474 |
|
||||
| | |issues with MOH | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | |Use ast_audiohook_write_list_empty| |
|
||||
|349289 |seanbright|to determine if our lists are | |
|
||||
| | |empty instead | |
|
||||
|--------+----------+----------------------------------+-----------------|
|
||||
| | | |ASTERISK-19040, |
|
||||
| | |Handle AST_CONTROL_UPDATE_RTP_PEER|ASTERISK-19128, |
|
||||
|349339 |mjordan |frames in local bridge loop |ASTERISK-17725, |
|
||||
| | | |ASTERISK-18340, |
|
||||
| | | |ASTERISK-19095 |
|
||||
+------------------------------------------------------------------------+
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
apps/app_authenticate.c | 15 +++-
|
||||
apps/app_chanspy.c | 56 +++++++++++-----
|
||||
apps/app_dial.c | 2
|
||||
apps/app_followme.c | 16 +++-
|
||||
apps/app_parkandannounce.c | 19 ++++-
|
||||
apps/app_queue.c | 2
|
||||
cel/cel_pgsql.c | 37 ++++-------
|
||||
channels/chan_iax2.c | 6 +
|
||||
channels/chan_sip.c | 28 +++++---
|
||||
configs/sip.conf.sample | 6 -
|
||||
configure.ac | 34 +++++++++-
|
||||
funcs/func_cdr.c | 20 ++++--
|
||||
include/asterisk/cdr.h | 32 +++++++--
|
||||
include/asterisk/frame.h | 2
|
||||
include/asterisk/module.h | 1
|
||||
include/asterisk/pbx.h | 42 +++++++++---
|
||||
main/audiohook.c | 4 +
|
||||
main/channel.c | 122 ++++++++++++++++++++++++------------
|
||||
main/features.c | 20 ++++--
|
||||
main/pbx.c | 150 ++++++++++++++++++++++++++++-----------------
|
||||
main/rtp_engine.c | 8 +-
|
||||
res/res_monitor.c | 6 +
|
||||
res/res_musiconhold.c | 21 ++++--
|
||||
res/res_timing_dahdi.c | 2
|
||||
res/res_timing_pthread.c | 2
|
||||
res/res_timing_timerfd.c | 2
|
||||
26 files changed, 452 insertions(+), 203 deletions(-)
|
||||
|
||||
----------------------------------------------------------------------
|
@@ -58,7 +58,8 @@ AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH], [use $3 in PATH]),
|
||||
AC_SUBST($2)
|
||||
])
|
||||
|
||||
# AST_EXT_LIB_SETUP_DEPENDENT([package symbol name], [package friendly name], [master package symbol name], [master package option name])
|
||||
# Setup required dependent package
|
||||
# AST_EXT_LIB_SETUP_DEPENDENT([dependent package symbol name], [dependent package friendly name], [master package symbol name], [master package name])
|
||||
|
||||
AC_DEFUN([AST_EXT_LIB_SETUP_DEPENDENT],
|
||||
[
|
||||
@@ -81,6 +82,23 @@ AC_SUBST([$1_DIR])
|
||||
AC_SUBST([PBX_$1])
|
||||
])
|
||||
|
||||
# Setup optional dependent package
|
||||
# AST_EXT_LIB_SETUP_OPTIONAL([optional package symbol name], [optional package friendly name], [master package symbol name], [master package name])
|
||||
|
||||
AC_DEFUN([AST_EXT_LIB_SETUP_OPTIONAL],
|
||||
[
|
||||
$1_DESCRIP="$2"
|
||||
m4_ifval([$4], [$1_OPTION=$4])
|
||||
m4_ifval([$3], [$1_DIR=${$3_DIR}
|
||||
])
|
||||
PBX_$1=0
|
||||
AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if $3 has the $2 feature.])
|
||||
AC_SUBST([$1_LIB])
|
||||
AC_SUBST([$1_INCLUDE])
|
||||
AC_SUBST([$1_DIR])
|
||||
AC_SUBST([PBX_$1])
|
||||
])
|
||||
|
||||
# Check for existence of a given package ($1), either looking up a function
|
||||
# in a library, or, if no function is supplied, only check for the
|
||||
# existence of the header files.
|
||||
|
@@ -1073,6 +1073,12 @@ static void destroy_escs(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \details
|
||||
* This container holds the dialogs that will be destroyed immediately.
|
||||
*/
|
||||
struct ao2_container *dialogs_to_destroy;
|
||||
|
||||
/*! \brief
|
||||
* Here we implement the container for dialogs (sip_pvt), defining
|
||||
* generic wrapper functions to ease the transition from the current
|
||||
@@ -4557,16 +4563,24 @@ static void sip_destroy_peer_fn(void *peer)
|
||||
static void sip_destroy_peer(struct sip_peer *peer)
|
||||
{
|
||||
ast_debug(3, "Destroying SIP peer %s\n", peer->name);
|
||||
if (peer->outboundproxy)
|
||||
|
||||
/*
|
||||
* Remove any mailbox event subscriptions for this peer before
|
||||
* we destroy anything. An event subscription callback may be
|
||||
* happening right now.
|
||||
*/
|
||||
clear_peer_mailboxes(peer);
|
||||
|
||||
if (peer->outboundproxy) {
|
||||
ao2_ref(peer->outboundproxy, -1);
|
||||
peer->outboundproxy = NULL;
|
||||
peer->outboundproxy = NULL;
|
||||
}
|
||||
|
||||
/* Delete it, it needs to disappear */
|
||||
if (peer->call) {
|
||||
dialog_unlink_all(peer->call, TRUE, TRUE);
|
||||
peer->call = dialog_unref(peer->call, "peer->call is being unset");
|
||||
}
|
||||
|
||||
|
||||
if (peer->mwipvt) { /* We have an active subscription, delete it */
|
||||
dialog_unlink_all(peer->mwipvt, TRUE, TRUE);
|
||||
@@ -4594,7 +4608,6 @@ static void sip_destroy_peer(struct sip_peer *peer)
|
||||
}
|
||||
if (peer->dnsmgr)
|
||||
ast_dnsmgr_release(peer->dnsmgr);
|
||||
clear_peer_mailboxes(peer);
|
||||
|
||||
if (peer->socket.tcptls_session) {
|
||||
ao2_ref(peer->socket.tcptls_session, -1);
|
||||
@@ -13473,7 +13486,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
|
||||
char data[SIPBUFSIZE];
|
||||
const char *expires = get_header(req, "Expires");
|
||||
int expire = atoi(expires);
|
||||
char *curi, *domain, *transport;
|
||||
char *curi = NULL, *domain = NULL, *transport = NULL;
|
||||
int transport_type;
|
||||
const char *useragent;
|
||||
struct ast_sockaddr oldsin, testsa;
|
||||
@@ -13551,7 +13564,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
|
||||
ast_string_field_build(pvt, our_contact, "<%s>", curi);
|
||||
|
||||
/* Make sure it's a SIP URL */
|
||||
if (parse_uri_legacy_check(curi, "sip:,sips:", &curi, NULL, &domain, &transport)) {
|
||||
if (ast_strlen_zero(curi) || parse_uri_legacy_check(curi, "sip:,sips:", &curi, NULL, &domain, &transport)) {
|
||||
ast_log(LOG_NOTICE, "Not a valid SIP contact (missing sip:/sips:) trying to use anyway\n");
|
||||
}
|
||||
|
||||
@@ -16422,14 +16435,12 @@ static void cleanup_stale_contexts(char *new, char *old)
|
||||
* \brief Match dialogs that need to be destroyed
|
||||
*
|
||||
* \details This is used with ao2_callback to unlink/delete all dialogs that
|
||||
* are marked needdestroy. It will return CMP_MATCH for candidates, and they
|
||||
* will be unlinked.
|
||||
* are marked needdestroy.
|
||||
*
|
||||
* \todo Re-work this to improve efficiency. Currently, this function is called
|
||||
* on _every_ dialog after processing _every_ incoming SIP/UDP packet, or
|
||||
* potentially even more often when the scheduler has entries to run.
|
||||
*/
|
||||
|
||||
static int dialog_needdestroy(void *dialogobj, void *arg, int flags)
|
||||
{
|
||||
struct sip_pvt *dialog = dialogobj;
|
||||
@@ -16475,10 +16486,10 @@ static int dialog_needdestroy(void *dialogobj, void *arg, int flags)
|
||||
}
|
||||
|
||||
sip_pvt_unlock(dialog);
|
||||
/* no, the unlink should handle this: dialog_unref(dialog, "needdestroy: one more refcount decrement to allow dialog to be destroyed"); */
|
||||
/* the CMP_MATCH will unlink this dialog from the dialog hash table */
|
||||
dialog_unlink_all(dialog, TRUE, FALSE);
|
||||
return 0; /* the unlink_all should unlink this from the table, so.... no need to return a match */
|
||||
|
||||
/* This dialog needs to be destroyed. */
|
||||
ao2_t_link(dialogs_to_destroy, dialog, "Link dialog for destruction");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sip_pvt_unlock(dialog);
|
||||
@@ -16486,6 +16497,25 @@ static int dialog_needdestroy(void *dialogobj, void *arg, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
* \brief ao2_callback to unlink the specified dialog object.
|
||||
*
|
||||
* \param obj Ptr to dialog to unlink.
|
||||
* \param arg Don't care.
|
||||
* \param flags Don't care.
|
||||
*
|
||||
* \retval CMP_MATCH
|
||||
*/
|
||||
static int dialog_unlink_callback(void *obj, void *arg, int flags)
|
||||
{
|
||||
struct sip_pvt *dialog = obj;
|
||||
|
||||
dialog_unlink_all(dialog, TRUE, TRUE);
|
||||
|
||||
return CMP_MATCH;
|
||||
}
|
||||
|
||||
/*! \brief Remove temporary realtime objects from memory (CLI) */
|
||||
/*! \todo XXXX Propably needs an overhaul after removal of the devices */
|
||||
static char *sip_prune_realtime(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||
@@ -18302,11 +18332,18 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
|
||||
per device. I don't want incoming callers to record calls in my
|
||||
pbx.
|
||||
*/
|
||||
/* first, get the feature string, if it exists */
|
||||
|
||||
struct ast_call_feature *feat;
|
||||
int j;
|
||||
struct ast_frame f = { AST_FRAME_DTMF, };
|
||||
|
||||
if (!p->owner) { /* not a PBX call */
|
||||
transmit_response(p, "481 Call leg/transaction does not exist", req);
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
return;
|
||||
}
|
||||
|
||||
/* first, get the feature string, if it exists */
|
||||
ast_rdlock_call_features();
|
||||
feat = ast_find_call_feature("automon");
|
||||
if (!feat || ast_strlen_zero(feat->exten)) {
|
||||
@@ -23884,11 +23921,21 @@ static int handle_request_publish(struct sip_pvt *p, struct sip_request *req, st
|
||||
return handler_result;
|
||||
}
|
||||
|
||||
/*! \internal \brief Subscribe to MWI events for the specified peer
|
||||
* \note The peer cannot be locked during this method. sip_send_mwi_peer will
|
||||
* attempt to lock the peer after the event subscription lock is held; if the peer is locked during
|
||||
* this method then we will attempt to lock the event subscription lock but after the peer, creating
|
||||
* a locking inversion.
|
||||
*/
|
||||
static void add_peer_mwi_subs(struct sip_peer *peer)
|
||||
{
|
||||
struct sip_mailbox *mailbox;
|
||||
|
||||
AST_LIST_TRAVERSE(&peer->mailboxes, mailbox, entry) {
|
||||
if (mailbox->event_sub) {
|
||||
ast_event_unsubscribe(mailbox->event_sub);
|
||||
}
|
||||
|
||||
mailbox->event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, "SIP mbox event", peer,
|
||||
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox->mailbox,
|
||||
AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, S_OR(mailbox->context, "default"),
|
||||
@@ -24042,7 +24089,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
/* if an authentication response was sent, we are done here */
|
||||
if (res == AUTH_CHALLENGE_SENT) /* authpeer = NULL here */
|
||||
return 0;
|
||||
if (res < 0) {
|
||||
if (res != AUTH_SUCCESSFUL) {
|
||||
if (res == AUTH_FAKE_AUTH) {
|
||||
ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
|
||||
transmit_fake_auth_response(p, SIP_SUBSCRIBE, req, XMIT_UNRELIABLE);
|
||||
@@ -24056,17 +24103,17 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
}
|
||||
}
|
||||
|
||||
/* At this point, authpeer cannot be NULL. Remember we hold a reference,
|
||||
* so we must release it when done.
|
||||
* XXX must remove all the checks for authpeer == NULL.
|
||||
/* At this point, we hold a reference to authpeer (if not NULL). It
|
||||
* must be released when done.
|
||||
*/
|
||||
|
||||
/* Check if this device is allowed to subscribe at all */
|
||||
if (!ast_test_flag(&p->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE)) {
|
||||
transmit_response(p, "403 Forbidden (policy)", req);
|
||||
pvt_set_needdestroy(p, "subscription not allowed");
|
||||
if (authpeer)
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 1)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24086,8 +24133,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
transmit_response(p, "404 Not Found", req);
|
||||
}
|
||||
pvt_set_needdestroy(p, "subscription target not found");
|
||||
if (authpeer)
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24102,9 +24150,6 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
enum subscriptiontype subscribed = NONE;
|
||||
const char *unknown_acceptheader = NULL;
|
||||
|
||||
if (authpeer) /* We do not need the authpeer any more */
|
||||
authpeer = unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
|
||||
|
||||
/* Header from Xten Eye-beam Accept: multipart/related, application/rlmi+xml, application/pidf+xml, application/xpidf+xml */
|
||||
accept = __get_header(req, "Accept", &start);
|
||||
while ((subscribed == NONE) && !ast_strlen_zero(accept)) {
|
||||
@@ -24142,6 +24187,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
p->subscribecontext,
|
||||
p->subscribeuri);
|
||||
pvt_set_needdestroy(p, "no Accept header");
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* if p->subscribed is non-zero, then accept is not obligatory; according to rfc 3265 section 3.1.3, at least.
|
||||
@@ -24166,6 +24214,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
p->subscribecontext,
|
||||
p->subscribeuri);
|
||||
pvt_set_needdestroy(p, "unrecognized format");
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 2)");
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
p->subscribed = subscribed;
|
||||
@@ -24188,8 +24239,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
transmit_response(p, "406 Not Acceptable", req);
|
||||
ast_debug(2, "Received SIP mailbox subscription for unknown format: %s\n", acceptheader);
|
||||
pvt_set_needdestroy(p, "unknown format");
|
||||
if (authpeer)
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 3)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* Looks like they actually want a mailbox status
|
||||
@@ -24198,30 +24250,39 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
In most devices, this is configurable to the voicemailmain extension you use
|
||||
*/
|
||||
if (!authpeer || AST_LIST_EMPTY(&authpeer->mailboxes)) {
|
||||
transmit_response(p, "404 Not found (no mailbox)", req);
|
||||
if (!authpeer) {
|
||||
transmit_response(p, "404 Not found", req);
|
||||
} else {
|
||||
transmit_response(p, "404 Not found (no mailbox)", req);
|
||||
ast_log(LOG_NOTICE, "Received SIP subscribe for peer without mailbox: %s\n", S_OR(authpeer->name, ""));
|
||||
}
|
||||
pvt_set_needdestroy(p, "received 404 response");
|
||||
ast_log(LOG_NOTICE, "Received SIP subscribe for peer without mailbox: %s\n", S_OR(authpeer->name, ""));
|
||||
if (authpeer)
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 4)");
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 3)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
p->subscribed = MWI_NOTIFICATION;
|
||||
if (ast_test_flag(&authpeer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
|
||||
ao2_unlock(p);
|
||||
add_peer_mwi_subs(authpeer);
|
||||
ao2_lock(p);
|
||||
}
|
||||
if (authpeer->mwipvt && authpeer->mwipvt != p) { /* Destroy old PVT if this is a new one */
|
||||
if (authpeer->mwipvt != p) { /* Destroy old PVT if this is a new one */
|
||||
/* We only allow one subscription per peer */
|
||||
dialog_unlink_all(authpeer->mwipvt, TRUE, TRUE);
|
||||
authpeer->mwipvt = dialog_unref(authpeer->mwipvt, "unref dialog authpeer->mwipvt");
|
||||
/* sip_destroy(authpeer->mwipvt); */
|
||||
if (authpeer->mwipvt) {
|
||||
dialog_unlink_all(authpeer->mwipvt, TRUE, TRUE);
|
||||
authpeer->mwipvt = dialog_unref(authpeer->mwipvt, "unref dialog authpeer->mwipvt");
|
||||
}
|
||||
authpeer->mwipvt = dialog_ref(p, "setting peers' mwipvt to p");
|
||||
}
|
||||
if (p->relatedpeer != authpeer) {
|
||||
if (p->relatedpeer) {
|
||||
unref_peer(p->relatedpeer, "Unref previously stored relatedpeer ptr");
|
||||
}
|
||||
p->relatedpeer = ref_peer(authpeer, "setting dialog's relatedpeer pointer");
|
||||
}
|
||||
if (authpeer->mwipvt)
|
||||
dialog_unref(authpeer->mwipvt, "Unref previously stored mwipvt dialog pointer");
|
||||
authpeer->mwipvt = dialog_ref(p, "setting peers' mwipvt to p"); /* Link from peer to pvt UH- should this be dialog_ref()? */
|
||||
if (p->relatedpeer)
|
||||
unref_peer(p->relatedpeer, "Unref previously stored relatedpeer ptr");
|
||||
p->relatedpeer = ref_peer(authpeer, "setting dialog's relatedpeer pointer"); /* already refcounted...Link from pvt to peer UH- should this be dialog_ref()? */
|
||||
/* Do not release authpeer here */
|
||||
} else if (!strcmp(event, "call-completion")) {
|
||||
handle_cc_subscribe(p, req);
|
||||
@@ -24229,16 +24290,12 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
transmit_response(p, "489 Bad Event", req);
|
||||
ast_debug(2, "Received SIP subscribe for unknown event package: %s\n", event);
|
||||
pvt_set_needdestroy(p, "unknown event package");
|
||||
if (authpeer)
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 5)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* At this point, if we have an authpeer we should unref it. */
|
||||
if (authpeer) {
|
||||
authpeer = unref_peer(authpeer, "unref pointer into (*authpeer)");
|
||||
}
|
||||
|
||||
/* Add subscription for extension state from the PBX core */
|
||||
if (p->subscribed != MWI_NOTIFICATION && p->subscribed != CALL_COMPLETION && !resubscribe) {
|
||||
if (p->stateid > -1) {
|
||||
@@ -24263,6 +24320,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
"with Expire header less that 'minexpire' limit. Received \"Expire: %d\" min is %d\n",
|
||||
p->exten, p->context, p->expiry, min_expiry);
|
||||
pvt_set_needdestroy(p, "Expires is less that the min expires allowed.");
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 6)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24284,7 +24344,12 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
|
||||
transmit_response(p, "200 OK", req);
|
||||
if (p->relatedpeer) { /* Send first notification */
|
||||
sip_send_mwi_to_peer(p->relatedpeer, 0);
|
||||
struct sip_peer *peer = p->relatedpeer;
|
||||
ref_peer(peer, "ensure a peer ref is held during MWI sending");
|
||||
ao2_unlock(p);
|
||||
sip_send_mwi_to_peer(peer, 0);
|
||||
ao2_lock(p);
|
||||
unref_peer(peer, "release a peer ref now that MWI is sent");
|
||||
}
|
||||
} else if (p->subscribed != CALL_COMPLETION) {
|
||||
if ((firststate = ast_extension_state(NULL, p->context, p->exten)) < 0) {
|
||||
@@ -24292,6 +24357,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
ast_log(LOG_NOTICE, "Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension.\n", p->exten, p->context, ast_sockaddr_stringify(&p->sa));
|
||||
transmit_response(p, "404 Not found", req);
|
||||
pvt_set_needdestroy(p, "no extension for SUBSCRIBE");
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 6)");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
|
||||
@@ -24307,6 +24375,10 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
pvt_set_needdestroy(p, "forcing expiration");
|
||||
}
|
||||
}
|
||||
|
||||
if (authpeer) {
|
||||
unref_peer(authpeer, "unref pointer into (*authpeer)");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -24995,36 +25067,51 @@ static int get_cached_mwi(struct sip_peer *peer, int *new, int *old)
|
||||
return in_cache;
|
||||
}
|
||||
|
||||
/*! \brief Send message waiting indication to alert peer that they've got voicemail */
|
||||
/*! \brief Send message waiting indication to alert peer that they've got voicemail
|
||||
* \note Both peer and associated sip_pvt must be unlocked prior to calling this function
|
||||
*/
|
||||
static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
|
||||
{
|
||||
/* Called with peerl lock, but releases it */
|
||||
/* Called with peer lock, but releases it */
|
||||
struct sip_pvt *p;
|
||||
int newmsgs = 0, oldmsgs = 0;
|
||||
const char *vmexten = NULL;
|
||||
|
||||
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt)
|
||||
ao2_lock(peer);
|
||||
|
||||
if (peer->vmexten) {
|
||||
vmexten = ast_strdupa(peer->vmexten);
|
||||
}
|
||||
|
||||
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
|
||||
ao2_unlock(peer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Do we have an IP address? If not, skip this peer */
|
||||
if (ast_sockaddr_isnull(&peer->addr) && ast_sockaddr_isnull(&peer->defaddr))
|
||||
if (ast_sockaddr_isnull(&peer->addr) && ast_sockaddr_isnull(&peer->defaddr)) {
|
||||
ao2_unlock(peer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Attempt to use cached mwi to get message counts. */
|
||||
if (!get_cached_mwi(peer, &newmsgs, &oldmsgs) && !cache_only) {
|
||||
/* Fall back to manually checking the mailbox if not cache_only and get_cached_mwi failed */
|
||||
struct ast_str *mailbox_str = ast_str_alloca(512);
|
||||
peer_mailboxes_to_str(&mailbox_str, peer);
|
||||
ao2_unlock(peer);
|
||||
ast_app_inboxcount(mailbox_str->str, &newmsgs, &oldmsgs);
|
||||
ao2_lock(peer);
|
||||
}
|
||||
ao2_lock(peer);
|
||||
|
||||
if (peer->mwipvt) {
|
||||
/* Base message on subscription */
|
||||
p = dialog_ref(peer->mwipvt, "sip_send_mwi_to_peer: Setting dialog ptr p from peer->mwipvt-- should this be done?");
|
||||
p = dialog_ref(peer->mwipvt, "sip_send_mwi_to_peer: Setting dialog ptr p from peer->mwipvt");
|
||||
ao2_unlock(peer);
|
||||
} else {
|
||||
ao2_unlock(peer);
|
||||
/* Build temporary dialog for this message */
|
||||
if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY, NULL))) {
|
||||
ao2_unlock(peer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -25038,7 +25125,6 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
|
||||
dialog_unlink_all(p, TRUE, TRUE);
|
||||
dialog_unref(p, "unref dialog p just created via sip_alloc");
|
||||
/* sip_destroy(p); */
|
||||
ao2_unlock(peer);
|
||||
return 0;
|
||||
}
|
||||
/* Recalculate our side, and recalculate Call ID */
|
||||
@@ -25046,11 +25132,15 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
|
||||
build_via(p);
|
||||
ao2_t_unlink(dialogs, p, "About to change the callid -- remove the old name");
|
||||
build_callid_pvt(p);
|
||||
|
||||
ao2_lock(peer);
|
||||
if (!ast_strlen_zero(peer->mwi_from)) {
|
||||
ast_string_field_set(p, mwi_from, peer->mwi_from);
|
||||
} else if (!ast_strlen_zero(default_mwi_from)) {
|
||||
ast_string_field_set(p, mwi_from, default_mwi_from);
|
||||
}
|
||||
ao2_unlock(peer);
|
||||
|
||||
ao2_t_link(dialogs, p, "Linking in under new name");
|
||||
/* Destroy this session after 32 secs */
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
@@ -25063,10 +25153,10 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
|
||||
/* Send MWI */
|
||||
ast_set_flag(&p->flags[0], SIP_OUTGOING);
|
||||
/* the following will decrement the refcount on p as it finishes */
|
||||
transmit_notify_with_mwi(p, newmsgs, oldmsgs, peer->vmexten);
|
||||
transmit_notify_with_mwi(p, newmsgs, oldmsgs, vmexten);
|
||||
sip_pvt_unlock(p);
|
||||
dialog_unref(p, "unref dialog ptr p just before it goes out of scope at the end of sip_send_mwi_to_peer.");
|
||||
ao2_unlock(peer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25179,12 +25269,19 @@ static void *do_monitor(void *data)
|
||||
of time since the last time we did it (when MWI is being sent, we can
|
||||
get back to this point every millisecond or less)
|
||||
*/
|
||||
ao2_t_callback(dialogs, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, dialog_needdestroy, &t,
|
||||
"callback to remove dialogs w/needdestroy");
|
||||
|
||||
/* the old methodology would be to restart the search for dialogs to delete with every
|
||||
dialog that was found and destroyed, probably because the list contents would change,
|
||||
so we'd need to restart. This isn't the best thing to do with callbacks. */
|
||||
/*
|
||||
* We cannot hold the dialogs container lock when we destroy a
|
||||
* dialog because of potential deadlocks. Instead we link the
|
||||
* doomed dialog into dialogs_to_destroy and then iterate over
|
||||
* that container destroying the dialogs.
|
||||
*/
|
||||
ao2_t_callback(dialogs, OBJ_NODATA | OBJ_MULTIPLE, dialog_needdestroy, &t,
|
||||
"callback to monitor dialog status");
|
||||
if (ao2_container_count(dialogs_to_destroy)) {
|
||||
/* Now destroy the found dialogs that need to be destroyed. */
|
||||
ao2_t_callback(dialogs_to_destroy, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE,
|
||||
dialog_unlink_callback, NULL, "callback to dialog_unlink_all");
|
||||
}
|
||||
|
||||
/* XXX TODO The scheduler usage in this module does not have sufficient
|
||||
* synchronization being done between running the scheduler and places
|
||||
@@ -26114,12 +26211,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "nat")) {
|
||||
ast_set_flag(&mask[0], SIP_NAT_FORCE_RPORT);
|
||||
ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT); /* Default to "force_rport" */
|
||||
if (!strcasecmp(v->value, "no")) {
|
||||
ast_clear_flag(&flags[0], SIP_NAT_FORCE_RPORT);
|
||||
} else if (!strcasecmp(v->value, "force_rport")) {
|
||||
ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT);
|
||||
} else if (!strcasecmp(v->value, "yes")) {
|
||||
ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT);
|
||||
/* We've already defaulted to force_rport */
|
||||
ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
|
||||
ast_set_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP);
|
||||
} else if (!strcasecmp(v->value, "comedia")) {
|
||||
@@ -26580,7 +26676,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
||||
found++;
|
||||
/* we've unlinked the peer from the peers container but not unlinked from the peers_by_ip container yet
|
||||
this leads to a wrong refcounter and the peer object is never destroyed */
|
||||
ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table");
|
||||
if (!ast_sockaddr_isnull(&peer->addr)) {
|
||||
ao2_t_unlink(peers_by_ip, peer, "ao2_unlink peer from peers_by_ip table");
|
||||
}
|
||||
if (!(peer->the_mark))
|
||||
firstpass = 0;
|
||||
} else {
|
||||
@@ -27224,6 +27322,18 @@ static int peer_markall_func(void *device, void *arg, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void display_nat_warning(const char *cat, int reason, struct ast_flags *flags) {
|
||||
int global_nat, specific_nat;
|
||||
|
||||
if (reason == CHANNEL_MODULE_LOAD && (specific_nat = ast_test_flag(&flags[0], SIP_NAT_FORCE_RPORT)) != (global_nat = ast_test_flag(&global_flags[0], SIP_NAT_FORCE_RPORT))) {
|
||||
ast_log(LOG_WARNING, "!!! PLEASE NOTE: Setting 'nat' for a peer/user that differs from the global setting can make\n");
|
||||
ast_log(LOG_WARNING, "!!! the name of that peer/user discoverable by an attacker. Replies for non-existent peers/users\n");
|
||||
ast_log(LOG_WARNING, "!!! will be sent to a different port than replies for an existing peer/user. If at all possible,\n");
|
||||
ast_log(LOG_WARNING, "!!! use the global 'nat' setting and do not set 'nat' per peer/user.\n");
|
||||
ast_log(LOG_WARNING, "!!! (config category='%s' global force_rport='%s' peer/user force_rport='%s')\n", cat, AST_CLI_YESNO(global_nat), AST_CLI_YESNO(specific_nat));
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief Re-read SIP.conf config file
|
||||
\note This function reloads all config data, except for
|
||||
active peers (with registrations). They will only
|
||||
@@ -27446,8 +27556,9 @@ static int reload_config(enum channelreloadreason reason)
|
||||
ast_copy_string(default_mohinterpret, DEFAULT_MOHINTERPRET, sizeof(default_mohinterpret));
|
||||
ast_copy_string(default_mohsuggest, DEFAULT_MOHSUGGEST, sizeof(default_mohsuggest));
|
||||
ast_copy_string(default_vmexten, DEFAULT_VMEXTEN, sizeof(default_vmexten));
|
||||
ast_set_flag(&global_flags[0], SIP_DTMF_RFC2833); /*!< Default DTMF setting: RFC2833 */
|
||||
ast_set_flag(&global_flags[0], SIP_DIRECT_MEDIA); /*!< Allow re-invites */
|
||||
ast_set_flag(&global_flags[0], SIP_DTMF_RFC2833); /*!< Default DTMF setting: RFC2833 */
|
||||
ast_set_flag(&global_flags[0], SIP_DIRECT_MEDIA); /*!< Allow re-invites */
|
||||
ast_set_flag(&global_flags[0], SIP_NAT_FORCE_RPORT); /*!< Default to nat=force_rport */
|
||||
ast_copy_string(default_engine, DEFAULT_ENGINE, sizeof(default_engine));
|
||||
ast_copy_string(default_parkinglot, DEFAULT_PARKINGLOT, sizeof(default_parkinglot));
|
||||
|
||||
@@ -28216,6 +28327,7 @@ static int reload_config(enum channelreloadreason reason)
|
||||
}
|
||||
peer = build_peer(cat, ast_variable_browse(cfg, cat), NULL, 0, 0);
|
||||
if (peer) {
|
||||
display_nat_warning(cat, reason, &peer->flags[0]);
|
||||
ao2_t_link(peers, peer, "link peer into peers table");
|
||||
if ((peer->type & SIP_TYPE_PEER) && !ast_sockaddr_isnull(&peer->addr)) {
|
||||
ao2_t_link(peers_by_ip, peer, "link peer into peers_by_ip table");
|
||||
@@ -29562,8 +29674,9 @@ static int load_module(void)
|
||||
peers = ao2_t_container_alloc(HASH_PEER_SIZE, peer_hash_cb, peer_cmp_cb, "allocate peers");
|
||||
peers_by_ip = ao2_t_container_alloc(HASH_PEER_SIZE, peer_iphash_cb, peer_ipcmp_cb, "allocate peers_by_ip");
|
||||
dialogs = ao2_t_container_alloc(HASH_DIALOG_SIZE, dialog_hash_cb, dialog_cmp_cb, "allocate dialogs");
|
||||
dialogs_to_destroy = ao2_t_container_alloc(1, NULL, NULL, "allocate dialogs_to_destroy");
|
||||
threadt = ao2_t_container_alloc(HASH_DIALOG_SIZE, threadt_hash_cb, threadt_cmp_cb, "allocate threadt table");
|
||||
if (!peers || !peers_by_ip || !dialogs || !threadt) {
|
||||
if (!peers || !peers_by_ip || !dialogs || !dialogs_to_destroy || !threadt) {
|
||||
ast_log(LOG_ERROR, "Unable to create primary SIP container(s)\n");
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
@@ -29821,6 +29934,7 @@ static int unload_module(void)
|
||||
ao2_t_ref(peers, -1, "unref the peers table");
|
||||
ao2_t_ref(peers_by_ip, -1, "unref the peers_by_ip table");
|
||||
ao2_t_ref(dialogs, -1, "unref the dialogs table");
|
||||
ao2_t_ref(dialogs_to_destroy, -1, "unref dialogs_to_destroy");
|
||||
ao2_t_ref(threadt, -1, "unref the thread table");
|
||||
ao2_t_ref(sip_monitor_instances, -1, "unref the sip_monitor_instances table");
|
||||
|
||||
|
@@ -469,7 +469,7 @@ enum check_auth_result {
|
||||
AUTH_PEER_NOT_DYNAMIC = -6,
|
||||
AUTH_ACL_FAILED = -7,
|
||||
AUTH_BAD_TRANSPORT = -8,
|
||||
AUTH_RTP_FAILED = 9,
|
||||
AUTH_RTP_FAILED = -9,
|
||||
};
|
||||
|
||||
/*! \brief States for outbound registrations (with register= lines in sip.conf */
|
||||
|
@@ -803,6 +803,14 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
; for their media streams is not actual port number that will be used on the nearer
|
||||
; side of the NAT.
|
||||
;
|
||||
; IT IS IMPORTANT TO NOTE that if the nat setting in the general section differs from
|
||||
; the nat setting in a peer definition, then the peer username will be discoverable
|
||||
; by outside parties as Asterisk will respond to different ports for defined and
|
||||
; undefined peers. For this reason it is recommended to ONLY DEFINE NAT SETTINGS IN THE
|
||||
; GENERAL SECTION. Specifically, if nat=force_rport in one section and nat=no in the
|
||||
; other, then valid users with settings differing from those in the general section will
|
||||
; be discoverable.
|
||||
;
|
||||
; In addition to these settings, Asterisk *always* uses 'symmetric RTP' mode as defined by
|
||||
; RFC 4961; Asterisk will always send RTP packets from the same port number it expects
|
||||
; to receive them on.
|
||||
@@ -1189,12 +1197,10 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
type=friend
|
||||
|
||||
[natted-phone](!,basic-options) ; another template inheriting basic-options
|
||||
nat=yes
|
||||
directmedia=no
|
||||
host=dynamic
|
||||
|
||||
[public-phone](!,basic-options) ; another template inheriting basic-options
|
||||
nat=no
|
||||
directmedia=yes
|
||||
|
||||
[my-codecs](!) ; a template for my preferred codecs
|
||||
@@ -1229,7 +1235,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
; on incoming calls to Asterisk
|
||||
;host=192.168.0.23 ; we have a static but private IP address
|
||||
; No registration allowed
|
||||
;nat=no ; there is not NAT between phone and Asterisk
|
||||
;directmedia=yes ; allow RTP voice traffic to bypass Asterisk
|
||||
;dtmfmode=info ; either RFC2833 or INFO for the BudgeTone
|
||||
;call-limit=1 ; permit only 1 outgoing call and 1 incoming call at a time
|
||||
@@ -1259,7 +1264,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
;regexten=1234 ; When they register, create extension 1234
|
||||
;callerid="Jane Smith" <5678>
|
||||
;host=dynamic ; This device needs to register
|
||||
;nat=yes ; X-Lite is behind a NAT router
|
||||
;directmedia=no ; Typically set to NO if behind NAT
|
||||
;disallow=all
|
||||
;allow=gsm ; GSM consumes far less bandwidth than ulaw
|
||||
@@ -1333,9 +1337,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
;type=friend
|
||||
;secret=blah
|
||||
;qualify=200 ; Qualify peer is no more than 200ms away
|
||||
;nat=yes ; This phone may be natted
|
||||
; Send SIP and RTP to the IP address that packet is
|
||||
; received from instead of trusting SIP headers
|
||||
;host=dynamic ; This device registers with us
|
||||
;directmedia=no ; Asterisk by default tries to redirect the
|
||||
; RTP media stream (audio) to go directly from
|
||||
|
20
configure.ac
20
configure.ac
@@ -408,6 +408,26 @@ AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
|
||||
AST_EXT_LIB_SETUP([POPT], [popt], [popt])
|
||||
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
|
||||
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI], [ISDN PRI Message Waiting Indication], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_MCID], [ISDN PRI Malicious Call ID], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_WAITING], [ISDN PRI call waiting supplementary service], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri])
|
||||
# ------------------------------------v
|
||||
# TODO: The code can be changed to always include these features now.
|
||||
# These features will always be present if pri_connected_line_update is available.
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_PROG_W_CAUSE], [ISDN progress with cause], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SERVICE_MESSAGES], [ISDN service messages], [PRI], [pri])
|
||||
AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [pri])
|
||||
# ------------------------------------^
|
||||
AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
|
||||
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
|
||||
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
|
||||
|
@@ -560,6 +560,59 @@
|
||||
/* Define to 1 if you have the ISDN PRI library. */
|
||||
#undef HAVE_PRI
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI advice of charge supplementary service
|
||||
events feature. */
|
||||
#undef HAVE_PRI_AOC_EVENTS
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI call hold feature. */
|
||||
#undef HAVE_PRI_CALL_HOLD
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI call rerouting and call deflection
|
||||
feature. */
|
||||
#undef HAVE_PRI_CALL_REROUTING
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI call waiting supplementary service
|
||||
feature. */
|
||||
#undef HAVE_PRI_CALL_WAITING
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI call completion supplementary service
|
||||
feature. */
|
||||
#undef HAVE_PRI_CCSS
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI hangup fix feature. */
|
||||
#undef HAVE_PRI_HANGUP_FIX
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI set_inbanddisconnect feature. */
|
||||
#undef HAVE_PRI_INBANDDISCONNECT
|
||||
|
||||
/* Define to 1 if PRI has the ISDN Layer 2 persistence option feature. */
|
||||
#undef HAVE_PRI_L2_PERSISTENCE
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI Malicious Call ID feature. */
|
||||
#undef HAVE_PRI_MCID
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI Message Waiting Indication feature. */
|
||||
#undef HAVE_PRI_MWI
|
||||
|
||||
/* Define to 1 if PRI has the ISDN progress with cause feature. */
|
||||
#undef HAVE_PRI_PROG_W_CAUSE
|
||||
|
||||
/* Define to 1 if PRI has the ISDN reverse charge feature. */
|
||||
#undef HAVE_PRI_REVERSE_CHARGE
|
||||
|
||||
/* Define to 1 if PRI has the ISDN service messages feature. */
|
||||
#undef HAVE_PRI_SERVICE_MESSAGES
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI keypad facility in SETUP feature. */
|
||||
#undef HAVE_PRI_SETUP_KEYPAD
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI subaddressing feature. */
|
||||
#undef HAVE_PRI_SUBADDR
|
||||
|
||||
/* Define to 1 if PRI has the ISDN PRI call transfer supplementary service
|
||||
feature. */
|
||||
#undef HAVE_PRI_TRANSFER
|
||||
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#undef HAVE_PTHREAD
|
||||
|
||||
@@ -772,16 +825,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. */
|
||||
@@ -1056,9 +1109,6 @@
|
||||
/* 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
|
||||
|
||||
|
@@ -3563,6 +3563,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
|
||||
case AST_CONTROL_SRCCHANGE:
|
||||
case AST_CONTROL_CONNECTED_LINE:
|
||||
case AST_CONTROL_REDIRECTING:
|
||||
case AST_CONTROL_UPDATE_RTP_PEER:
|
||||
case -1:
|
||||
/* Unimportant */
|
||||
break;
|
||||
|
@@ -889,7 +889,8 @@ static enum ast_bridge_result local_bridge_loop(struct ast_channel *c0, struct a
|
||||
(fr->subclass.integer == AST_CONTROL_UNHOLD) ||
|
||||
(fr->subclass.integer == AST_CONTROL_VIDUPDATE) ||
|
||||
(fr->subclass.integer == AST_CONTROL_SRCUPDATE) ||
|
||||
(fr->subclass.integer == AST_CONTROL_T38_PARAMETERS)) {
|
||||
(fr->subclass.integer == AST_CONTROL_T38_PARAMETERS) ||
|
||||
(fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {
|
||||
/* If we are going on hold, then break callback mode and P2P bridging */
|
||||
if (fr->subclass.integer == AST_CONTROL_HOLD) {
|
||||
if (instance0->engine->local_bridge) {
|
||||
@@ -910,7 +911,10 @@ static enum ast_bridge_result local_bridge_loop(struct ast_channel *c0, struct a
|
||||
instance0->bridged = instance1;
|
||||
instance1->bridged = instance0;
|
||||
}
|
||||
ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
|
||||
/* Since UPDATE_BRIDGE_PEER is only used by the bridging code, don't forward it */
|
||||
if (fr->subclass.integer != AST_CONTROL_UPDATE_RTP_PEER) {
|
||||
ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
|
||||
}
|
||||
ast_frfree(fr);
|
||||
} else if (fr->subclass.integer == AST_CONTROL_CONNECTED_LINE) {
|
||||
if (ast_channel_connected_line_macro(who, other, fr, other == c0, 1)) {
|
||||
|
Reference in New Issue
Block a user