[-]
[+]
|
Changed |
asterisk.changes
|
|
[-]
[+]
|
Changed |
asterisk.spec
^
|
|
[-]
[+]
|
Deleted |
asterisk-1.8.13.0.tar.xz/asterisk-1.8.13.0-summary.html
^
|
@@ -1,449 +0,0 @@
-<!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.13.0</title></head>
-<body>
-<h1 align="center"><a name="top">Release Summary</a></h1>
-<h3 align="center">asterisk-1.8.13.0</h3>
-<h3 align="center">Date: 2012-06-04</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="#issues">Closed Issues</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.12.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>
-21 mjordan<br/>
-14 rmudgett<br/>
-7 kmoore<br/>
-6 twilson<br/>
-4 jrose<br/>
-3 bebuild<br/>
-3 mmichelson<br/>
-2 Makoto<br/>
-2 pabelanger<br/>
-1 alecdavis<br/>
-1 Barry<br/>
-1 Corey<br/>
-1 elguero<br/>
-1 Gunther<br/>
-1 markm<br/>
-1 Matt<br/>
-1 may<br/>
-1 Michael<br/>
-1 qwell<br/>
-1 russell<br/>
-1 seanbright<br/>
-1 Steve<br/>
-1 tilghman<br/>
-1 wdoekes<br/>
-</td>
-<td>
-3 Michael L. Young<br/>
-3 rmudgett<br/>
-2 Andrey Solovyev<br/>
-2 Ben Klang<br/>
-2 feyfre<br/>
-2 Mario<br/>
-1 Maciej Karjewski<br/>
-1 Matt Jordan<br/>
-1 Terry Wilson<br/>
-</td>
-<td>
-2 jamicque<br/>
-2 kobaz<br/>
-2 makoto<br/>
-2 mjordan<br/>
-1 aphiaspring87<br/>
-1 awktane<br/>
-1 babak2536<br/>
-1 bjm<br/>
-1 coreyfarrell<br/>
-1 corruptor<br/>
-1 dan_lukes<br/>
-1 davidw<br/>
-1 elguero<br/>
-1 evrinoma@gmail.com<br/>
-1 feyfre<br/>
-1 gkelleter<br/>
-1 jkroon<br/>
-1 lgfsantos<br/>
-1 one47<br/>
-1 slavon<br/>
-1 susu<br/>
-1 tomaso<br/>
-1 tzafrir<br/>
-</td>
-</tr>
-</table>
-<hr/>
-<a name="issues"><h2 align="center">Closed Issues</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
-<h3>Category: Addons/chan_ooh323</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19445">ASTERISK-19445</a>: Incorrect values are specified as length in memcpy and memset<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361210">361210</a><br/>
-Reporter: makoto<br/>
-Coders: Makoto<br/>
-<br/>
-<h3>Category: Applications/app_confbridge</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19471">ASTERISK-19471</a>: ConfBridge does not record anything<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364277">364277</a><br/>
-Reporter: feyfre<br/>
-Testers: Ben Klang, Michael L. Young, feyfre<br/>
-Coders: mjordan<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19641">ASTERISK-19641</a>: ConfBridge app plays conf-placeintoconf message to bridge, and not to joining channel<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364786">364786</a><br/>
-Reporter: aphiaspring87<br/>
-Coders: kmoore<br/>
-<br/>
-<h3>Category: Applications/app_dial</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19551">ASTERISK-19551</a>: Dial with Gosub autoservice error message is misleading<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361329">361329</a><br/>
-Reporter: awktane<br/>
-Coders: kmoore<br/>
-<br/>
-<h3>Category: Applications/app_forkcdr</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19164">ASTERISK-19164</a>: ForkCDR with 'e' option to set end time is overzealous<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362082">362082</a><br/>
-Reporter: one47<br/>
-Coders: Steve<br/>
-<br/>
-<h3>Category: Applications/app_mixmonitor</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19727">ASTERISK-19727</a>: MixMonitor does not work on local channels<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364277">364277</a><br/>
-Reporter: kobaz<br/>
-Testers: Ben Klang, Michael L. Young, feyfre<br/>
-Coders: mjordan<br/>
-<br/>
-<h3>Category: Channels/chan_dahdi</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19708">ASTERISK-19708</a>: Call Deflection with DAHDISendCallreroutingFacility on EuroISDN not working<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363730">363730</a><br/>
-Reporter: babak2536<br/>
-Testers: rmudgett<br/>
-Coders: rmudgett<br/>
-<br/>
-<h3>Category: Channels/chan_iax2</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19521">ASTERISK-19521</a>: chan_iax2 does not honor trunkfreq config option<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361972">361972</a><br/>
-Reporter: jkroon<br/>
-Coders: kmoore<br/>
-<br/>
-<h3>Category: Channels/chan_sip/General</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18321">ASTERISK-18321</a>: dynamic_exclude_static option with (temporary) unreachable DNS cause the abend<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364341">364341</a><br/>
-Reporter: dan_lukes<br/>
-Coders: mmichelson<br/>
-<br/>
-<h3>Category: Channels/chan_sip/IPv6</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19456">ASTERISK-19456</a>: Turn Off Warning Message When Bind Address Is Set To ANY<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362253">362253</a><br/>
-Reporter: elguero<br/>
-Testers: Michael L. Young<br/>
-Coders: Michael<br/>
-<br/>
-<h3>Category: Channels/chan_sip/Messaging</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19770">ASTERISK-19770</a>: Security Vulnerability: Segmentation fault when receiving an out-of-dialogue SIP UPDATE including a rpid info<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363106">363106</a><br/>
-Reporter: tomaso<br/>
-Testers: Matt Jordan<br/>
-Coders: Matt<br/>
-<br/>
-<h3>Category: Channels/chan_skinny</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19592">ASTERISK-19592</a>: Security Vulnerability: heap overflow exists in chan_skinny's handling of KEYPAD_BUTTON_MESSAGE<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363102">363102</a><br/>
-Reporter: mjordan<br/>
-Coders: mjordan<br/>
-<br/>
-<h3>Category: Core/Channels</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19579">ASTERISK-19579</a>: ERROR we couldn't allocate a port for RTP instance while DAHDI bridgeing<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363986">363986</a><br/>
-Reporter: jamicque<br/>
-Coders: kmoore<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19579">ASTERISK-19579</a>: ERROR we couldn't allocate a port for RTP instance while DAHDI bridgeing<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364258">364258</a><br/>
-Reporter: jamicque<br/>
-Testers: Maciej Karjewski<br/>
-Coders: kmoore<br/>
-<br/>
-<h3>Category: Core/General</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18308">ASTERISK-18308</a>: Problem with batch-creation of astdb entries<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362536">362536</a><br/>
-Reporter: tzafrir<br/>
-Coders: twilson<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19646">ASTERISK-19646</a>: Fix typo \n in chan_sip SDP negotiation warning message<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361332">361332</a><br/>
-Reporter: slavon<br/>
-Coders: mjordan<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19755">ASTERISK-19755</a>: __ao2_ref() validates user_data twice<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364902">364902</a><br/>
-Reporter: gkelleter<br/>
-Coders: Gunther<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19815">ASTERISK-19815</a>: Crash in core show locks when BETTER_BACKTRACES is enabled<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364635">364635</a><br/>
-Reporter: kobaz<br/>
-Coders: markm<br/>
-<br/>
-<h3>Category: Core/ManagerInterface</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-17465">ASTERISK-17465</a>: Security Vulnerability: AMI access to SHELL function only seems to need CALL Privilege, should be SYSTEM<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363141">363141</a><br/>
-Reporter: davidw<br/>
-Coders: jrose<br/>
-<br/>
-<h3>Category: Core/PBX</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19718">ASTERISK-19718</a>: ast_app_inboxcount2() calls ast_inboxcount2_func without checking if it's assigned (instead checks ast_inboxcount_func)<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364769">364769</a><br/>
-Reporter: coreyfarrell<br/>
-Coders: Corey<br/>
-<br/>
-<h3>Category: Core/Portability</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19758">ASTERISK-19758</a>: main/asterisk.c rawmemchr() undefined on OpenBSD<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362868">362868</a><br/>
-Reporter: bjm<br/>
-Testers: Terry Wilson<br/>
-Coders: Barry<br/>
-<br/>
-<h3>Category: Features</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19383">ASTERISK-19383</a>: Asterisk 1.8.5.0 - atxfer authorization problem when a call returns for reject or no answer<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363428">363428</a><br/>
-Reporter: lgfsantos<br/>
-Coders: rmudgett<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19445">ASTERISK-19445</a>: Incorrect values are specified as length in memcpy and memset<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361210">361210</a><br/>
-Reporter: makoto<br/>
-Coders: Makoto<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19633">ASTERISK-19633</a>: Having any h extension in peer's context breaks unaccepted attended feature transfers<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364060">364060</a><br/>
-Reporter: corruptor<br/>
-Testers: rmudgett, Andrey Solovyev, Mario<br/>
-Coders: rmudgett<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19717">ASTERISK-19717</a>: Attended transfer hangup<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364060">364060</a><br/>
-Reporter: susu<br/>
-Testers: rmudgett, Andrey Solovyev, Mario<br/>
-Coders: rmudgett<br/>
-<br/>
-<h3>Category: Functions/func_devstate</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19444">ASTERISK-19444</a>: Usage for CLI command 'devstate change' is truncated by an unnecessary comma<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361201">361201</a><br/>
-Reporter: makoto<br/>
-Coders: Makoto<br/>
-<br/>
-<h3>Category: General</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19462">ASTERISK-19462</a>: asterisk Illegal Instruction (core dumped)<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361955">361955</a><br/>
-Reporter: evrinoma@gmail.com<br/>
-Coders: kmoore<br/>
-<br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19656">ASTERISK-19656</a>: Coverity Report: Fix issues for error type ARRAY_VS_SINGLETON<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364899">364899</a><br/>
-Reporter: mjordan<br/>
-Coders: mmichelson<br/>
-<br/>
-<h3>Category: Resources/res_adsi</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19445">ASTERISK-19445</a>: Incorrect values are specified as length in memcpy and memset<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361210">361210</a><br/>
-Reporter: makoto<br/>
-Coders: Makoto<br/>
-<br/>
-<h3>Category: Resources/res_crypto</h3><br/>
-<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19445">ASTERISK-19445</a>: Incorrect values are specified as length in memcpy and memset<br/>
-Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361210">361210</a><br/>
-Reporter: makoto<br/>
-Coders: Makoto<br/>
-<br/>
-<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=361269">361269</a></td><td>jrose</td><td>Fix MusicOnHold in MeetMe so that it always uses the class if it's been defined</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361380">361380</a></td><td>russell</td><td>Remove a few more files related to chan_usbradio and app_rpt.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361403">361403</a></td><td>pabelanger</td><td>Fix typo in svn:keywords</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361412">361412</a></td><td>pabelanger</td><td>Fix typo in svn:keywords</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361471">361471</a></td><td>kmoore</td><td>Add missing newlines to CLI logging</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361558">361558</a></td><td>mjordan</td><td>Fix memory leak when using MeetMeAdmin 'e' option with user specified</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361606">361606</a></td><td>mjordan</td><td>Fix memory leak in res_calendar_ews when event email address node is empty</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361657">361657</a></td><td>mjordan</td><td>Change SHARED function to use a safe traversal when modifying a variable</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361705">361705</a></td><td>mjordan</td><td>Prevent invalid access of free'd memory if DAHDI channel during an MWI event</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361753">361753</a></td><td>mjordan</td><td>Allow func_curl to exit gracefully if list allocation fails during write</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361803">361803</a></td><td>mjordan</td><td>Fix crash caused by unloading or reloading of res_http_post</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=361854">361854</a></td><td>rmudgett</td><td>Prevent invalid access of free'd memory if DAHDI channel during an MWI event</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362079">362079</a></td><td>jrose</td><td>Send relative path named recordings to the meetme directory instead of sounds</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362151">362151</a></td><td>mjordan</td><td>Check for IO stream failures in various format's truncate/seek operations</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362201">362201</a></td><td>mjordan</td><td>Fix handling of negative return code when storing voicemails in ODBC storage</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362204">362204</a></td><td>mjordan</td><td>Fix negative return handling in channel drivers</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362304">362304</a></td><td>mjordan</td><td>Fix error that caused seek format operations to set max file size to '1' or '0'</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362354">362354</a></td><td>jrose</td><td>Make use of va_args more appropriate to form in various res_config modules plus utils.</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19451">ASTERISK-19451</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362355">362355</a></td><td>mjordan</td><td>Fix places where a negative return from ftello could be used as invalid input</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362359">362359</a></td><td>mjordan</td><td>Fix places in main where a negative return value could impact execution</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362362">362362</a></td><td>mjordan</td><td>Fix places in resources where a negative return value could impact execution</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362368">362368</a></td><td>mjordan</td><td>Handle case where an unknown format is used to get the preferred codec size</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362428">362428</a></td><td>rmudgett</td><td>Add ability to ignore layer 1 alarms for BRI PTMP lines.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362485">362485</a></td><td>mjordan</td><td>Fix a variety of potential buffer overflows</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19668">ASTERISK-19668</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362586">362586</a></td><td>seanbright</td><td>Prevent a crash in ExternalIVR when the 'S' command is sent first.</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-17889">ASTERISK-17889</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362677">362677</a></td><td>rmudgett</td><td>Update membermacro and membergosub documentation in queues.conf.sample.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362680">362680</a></td><td>elguero</td><td>Add leading and trailing backslashes</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362729">362729</a></td><td>wdoekes</td><td>Fix documentation for ${VERSION(ASTERISK_VERSION_NUM)}.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362815">362815</a></td><td>twilson</td><td>Document Speech* apps hangup on failure and suggest TryExec</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=362997">362997</a></td><td>rmudgett</td><td>Update app_dial M and U option GOTO return value documentation.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363209">363209</a></td><td>tilghman</td><td>On some platforms, O_RDONLY is not a flag to be checked, but merely the absence of O_RDWR and O_WRONLY.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363375">363375</a></td><td>rmudgett</td><td>Hangup affected channel in error paths of bridge_call_thread().</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363687">363687</a></td><td>rmudgett</td><td>Clear ISDN channel resetting state if the peer continues to use it.</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19608">ASTERISK-19608</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363788">363788</a></td><td>rmudgett</td><td>Update Pickup application documentation.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363875">363875</a></td><td>rmudgett</td><td>Update Pickup application documentation. (Even better)</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=363934">363934</a></td><td>alecdavis</td><td>chan_sip: [general] maxforwards, not checked for a value greater than 255</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364046">364046</a></td><td>twilson</td><td>Add more constness to the end_buf pointer in the netconsole</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-18308">ASTERISK-18308</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364108">364108</a></td><td>rmudgett</td><td>Update Pickup application documentation. (With feeling this time.)</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364203">364203</a></td><td>mjordan</td><td>Allow for reloading SRTP crypto keys within the same SIP dialog</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19253">ASTERISK-19253</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364340">364340</a></td><td>twilson</td><td>Fix ast_parse_arg numeric type range checking and add tests</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364578">364578</a></td><td>mjordan</td><td>Fix error that caused truncate operations to fail</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19655">ASTERISK-19655</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-19810">ASTERISK-19810</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364649">364649</a></td><td>may</td><td>Fix use freed pointer in return value from call thread</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-19663">ASTERISK-19663</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364706">364706</a></td><td>mmichelson</td><td>Revert improved identities sent in dialog-info NOTIFY requests in r360862</td>
-<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-16735">ASTERISK-16735</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364840">364840</a></td><td>rmudgett</td><td>* Fix error path resouce leak in local_request().</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=364841">364841</a></td><td>qwell</td><td>Prevent a potential crash when using manager hooks.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=365006">365006</a></td><td>twilson</td><td>Fix a CEL LINKEDID_END race and local channel linkedids</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=365068">365068</a></td><td>twilson</td><td>Don't leak a ref if out of memory and can't link the linkedid</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=367959">367959</a></td><td>bebuild</td><td>Create 1.8.13.0-rc2</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=367965">367965</a></td><td>bebuild</td><td>Merge r367781,367843,367266 for 1.8.13.0-rc2</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=367971">367971</a></td><td>bebuild</td><td>Importing release summary for 1.8.13.0-rc2 release.</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 | 21 +
-Makefile | 47 --
-Makefile.rules | 4
-addons/chan_mobile.c | 6
-addons/ooh323cDriver.c | 5
-apps/app_chanspy.c | 8
-apps/app_confbridge.c | 11
-apps/app_dial.c | 14
-apps/app_directed_pickup.c | 49 +-
-apps/app_externalivr.c | 16
-apps/app_forkcdr.c | 11
-apps/app_ices.c | 2
-apps/app_meetme.c | 45 ++
-apps/app_sms.c | 12
-apps/app_speech_utils.c | 9
-apps/app_voicemail.c | 16
-apps/rpt_flow.pdf | 576 ----------------------------
-asterisk-1.8.13.0-rc1-summary.html | 434 ---------------------
-asterisk-1.8.13.0-rc1-summary.txt | 584 -----------------------------
-asterisk-1.8.13.0-rc2-summary.html | 62 +++
-asterisk-1.8.13.0-rc2-summary.txt | 92 ++++
-build_tools/cflags.xml | 5
-build_tools/menuselect-deps.in | 1
-channels/chan_agent.c | 2
-channels/chan_dahdi.c | 82 +++-
-channels/chan_gtalk.c | 14
-channels/chan_iax2.c | 39 +
-channels/chan_local.c | 35 +
-channels/chan_mgcp.c | 2
-channels/chan_sip.c | 108 ++---
-channels/chan_skinny.c | 60 ++-
-channels/chan_unistim.c | 13
-channels/console_gui.c | 6
-channels/console_video.c | 2
-channels/sig_pri.c | 97 +++-
-channels/sig_pri.h | 28 +
-codecs/gsm/Makefile | 43 --
-codecs/gsm/src/k6opt.s | 739 -------------------------------------
-codecs/lpc10/Makefile | 26 -
-configs/chan_dahdi.conf.sample | 12
-configs/queues.conf.sample | 10
-configs/rpt.conf.sample | 193 ---------
-configs/usbradio.conf.sample | 61 ---
-configure.ac | 15
-formats/format_g719.c | 28 +
-formats/format_g723.c | 15
-formats/format_g729.c | 15
-formats/format_gsm.c | 55 ++
-formats/format_h263.c | 15
-formats/format_h264.c | 15
-formats/format_ilbc.c | 15
-formats/format_ogg_vorbis.c | 2
-formats/format_pcm.c | 65 ++-
-formats/format_siren14.c | 29 +
-formats/format_siren7.c | 29 +
-formats/format_sln.c | 36 +
-formats/format_sln16.c | 29 +
-formats/format_vox.c | 66 ++-
-formats/format_wav.c | 39 +
-formats/format_wav_gsm.c | 37 +
-funcs/func_channel.c | 2
-funcs/func_curl.c | 1
-funcs/func_devstate.c | 2
-funcs/func_env.c | 34 +
-funcs/func_global.c | 5
-funcs/func_strings.c | 4
-funcs/func_sysinfo.c | 2
-funcs/func_version.c | 3
-funcs/func_volume.c | 2
-include/asterisk/time.h | 5
-main/app.c | 2
-main/asterisk.c | 62 ++-
-main/astfd.c | 4
-main/astobj2.c | 5
-main/cdr.c | 2
-main/cel.c | 98 ++--
-main/config.c | 126 ++++--
-main/features.c | 241 ++++++------
-main/frame.c | 10
-main/http.c | 12
-main/jitterbuf.c | 8
-main/logger.c | 3
-main/manager.c | 97 +++-
-main/pbx.c | 4
-main/stdtime/localtime.c | 6
-main/tcptls.c | 2
-main/tdd.c | 28 -
-main/translate.c | 33 +
-main/utils.c | 2
-main/xmldoc.c | 2
-makeopts.in | 1
-res/res_agi.c | 12
-res/res_calendar_ews.c | 2
-res/res_clioriginate.c | 1
-res/res_config_curl.c | 7
-res/res_config_odbc.c | 73 ++-
-res/res_config_pgsql.c | 12
-res/res_config_sqlite.c | 2
-res/res_fax.c | 2
-res/res_musiconhold.c | 2
-res/res_rtp_asterisk.c | 5
-res/res_srtp.c | 2
-tests/test_config.c | 286 ++++++++++++++
-tests/test_linkedlists.c | 2
-tests/test_poll.c | 2
-utils/extconf.c | 2
-107 files changed, 1961 insertions(+), 3368 deletions(-)
-</pre><br/>
-<hr/>
-</body>
-</html>
|
[-]
[+]
|
Deleted |
asterisk-1.8.13.0.tar.xz/asterisk-1.8.13.0-summary.txt
^
|
@@ -1,600 +0,0 @@
- Release Summary
-
- asterisk-1.8.13.0
-
- Date: 2012-06-04
-
- <asteriskteam@digium.com>
-
- ----------------------------------------------------------------------
-
- Table of Contents
-
- 1. Summary
- 2. Contributors
- 3. Closed Issues
- 4. Other Changes
- 5. 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.12.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
- 21 mjordan 3 Michael L. Young 2 jamicque
- 14 rmudgett 3 rmudgett 2 kobaz
- 7 kmoore 2 Andrey Solovyev 2 makoto
- 6 twilson 2 Ben Klang 2 mjordan
- 4 jrose 2 feyfre 1 aphiaspring87
- 3 bebuild 2 Mario 1 awktane
- 3 mmichelson 1 Maciej Karjewski 1 babak2536
- 2 Makoto 1 Matt Jordan 1 bjm
- 2 pabelanger 1 Terry Wilson 1 coreyfarrell
- 1 alecdavis 1 corruptor
- 1 Barry 1 dan_lukes
- 1 Corey 1 davidw
- 1 elguero 1 elguero
- 1 Gunther 1 evrinoma@gmail.com
- 1 markm 1 feyfre
- 1 Matt 1 gkelleter
- 1 may 1 jkroon
- 1 Michael 1 lgfsantos
- 1 qwell 1 one47
- 1 russell 1 slavon
- 1 seanbright 1 susu
- 1 Steve 1 tomaso
- 1 tilghman 1 tzafrir
- 1 wdoekes
-
- ----------------------------------------------------------------------
-
- Closed Issues
-
- [Back to Top]
-
- This is a list of all issues from the issue tracker that were closed by
- changes that went into this release.
-
- Category: Addons/chan_ooh323
-
- ASTERISK-19445: Incorrect values are specified as length in memcpy and
- memset
- Revision: 361210
- Reporter: makoto
- Coders: Makoto
-
- Category: Applications/app_confbridge
-
- ASTERISK-19471: ConfBridge does not record anything
- Revision: 364277
- Reporter: feyfre
- Testers: Ben Klang, Michael L. Young, feyfre
- Coders: mjordan
-
- ASTERISK-19641: ConfBridge app plays conf-placeintoconf message to bridge,
- and not to joining channel
- Revision: 364786
- Reporter: aphiaspring87
- Coders: kmoore
-
- Category: Applications/app_dial
-
- ASTERISK-19551: Dial with Gosub autoservice error message is misleading
- Revision: 361329
- Reporter: awktane
- Coders: kmoore
-
- Category: Applications/app_forkcdr
-
- ASTERISK-19164: ForkCDR with 'e' option to set end time is overzealous
- Revision: 362082
- Reporter: one47
- Coders: Steve
-
- Category: Applications/app_mixmonitor
-
- ASTERISK-19727: MixMonitor does not work on local channels
- Revision: 364277
- Reporter: kobaz
- Testers: Ben Klang, Michael L. Young, feyfre
- Coders: mjordan
-
- Category: Channels/chan_dahdi
-
- ASTERISK-19708: Call Deflection with DAHDISendCallreroutingFacility on
- EuroISDN not working
- Revision: 363730
- Reporter: babak2536
- Testers: rmudgett
- Coders: rmudgett
-
- Category: Channels/chan_iax2
-
- ASTERISK-19521: chan_iax2 does not honor trunkfreq config option
- Revision: 361972
- Reporter: jkroon
- Coders: kmoore
-
- Category: Channels/chan_sip/General
-
- ASTERISK-18321: dynamic_exclude_static option with (temporary) unreachable
- DNS cause the abend
- Revision: 364341
- Reporter: dan_lukes
- Coders: mmichelson
-
- Category: Channels/chan_sip/IPv6
-
- ASTERISK-19456: Turn Off Warning Message When Bind Address Is Set To ANY
- Revision: 362253
- Reporter: elguero
- Testers: Michael L. Young
- Coders: Michael
-
- Category: Channels/chan_sip/Messaging
-
- ASTERISK-19770: Security Vulnerability: Segmentation fault when receiving
- an out-of-dialogue SIP UPDATE including a rpid info
- Revision: 363106
- Reporter: tomaso
- Testers: Matt Jordan
- Coders: Matt
-
- Category: Channels/chan_skinny
-
- ASTERISK-19592: Security Vulnerability: heap overflow exists in
- chan_skinny's handling of KEYPAD_BUTTON_MESSAGE
- Revision: 363102
- Reporter: mjordan
- Coders: mjordan
-
- Category: Core/Channels
-
- ASTERISK-19579: ERROR we couldn't allocate a port for RTP instance while
- DAHDI bridgeing
- Revision: 363986
- Reporter: jamicque
- Coders: kmoore
-
- ASTERISK-19579: ERROR we couldn't allocate a port for RTP instance while
- DAHDI bridgeing
- Revision: 364258
- Reporter: jamicque
- Testers: Maciej Karjewski
- Coders: kmoore
-
- Category: Core/General
-
- ASTERISK-18308: Problem with batch-creation of astdb entries
- Revision: 362536
- Reporter: tzafrir
- Coders: twilson
-
- ASTERISK-19646: Fix typo \n in chan_sip SDP negotiation warning message
- Revision: 361332
- Reporter: slavon
- Coders: mjordan
-
- ASTERISK-19755: __ao2_ref() validates user_data twice
- Revision: 364902
- Reporter: gkelleter
- Coders: Gunther
-
- ASTERISK-19815: Crash in core show locks when BETTER_BACKTRACES is enabled
- Revision: 364635
- Reporter: kobaz
- Coders: markm
-
- Category: Core/ManagerInterface
-
- ASTERISK-17465: Security Vulnerability: AMI access to SHELL function only
- seems to need CALL Privilege, should be SYSTEM
- Revision: 363141
- Reporter: davidw
- Coders: jrose
-
- Category: Core/PBX
-
- ASTERISK-19718: ast_app_inboxcount2() calls ast_inboxcount2_func without
- checking if it's assigned (instead checks ast_inboxcount_func)
- Revision: 364769
- Reporter: coreyfarrell
- Coders: Corey
-
- Category: Core/Portability
-
- ASTERISK-19758: main/asterisk.c rawmemchr() undefined on OpenBSD
- Revision: 362868
- Reporter: bjm
- Testers: Terry Wilson
- Coders: Barry
-
- Category: Features
-
- ASTERISK-19383: Asterisk 1.8.5.0 - atxfer authorization problem when a
- call returns for reject or no answer
- Revision: 363428
- Reporter: lgfsantos
- Coders: rmudgett
-
- ASTERISK-19445: Incorrect values are specified as length in memcpy and
- memset
- Revision: 361210
- Reporter: makoto
- Coders: Makoto
-
- ASTERISK-19633: Having any h extension in peer's context breaks unaccepted
- attended feature transfers
- Revision: 364060
- Reporter: corruptor
- Testers: rmudgett, Andrey Solovyev, Mario
- Coders: rmudgett
-
- ASTERISK-19717: Attended transfer hangup
- Revision: 364060
- Reporter: susu
- Testers: rmudgett, Andrey Solovyev, Mario
- Coders: rmudgett
-
- Category: Functions/func_devstate
-
- ASTERISK-19444: Usage for CLI command 'devstate change' is truncated by an
- unnecessary comma
- Revision: 361201
- Reporter: makoto
- Coders: Makoto
-
- Category: General
-
- ASTERISK-19462: asterisk Illegal Instruction (core dumped)
- Revision: 361955
- Reporter: evrinoma@gmail.com
- Coders: kmoore
-
- ASTERISK-19656: Coverity Report: Fix issues for error type
- ARRAY_VS_SINGLETON
- Revision: 364899
- Reporter: mjordan
- Coders: mmichelson
-
- Category: Resources/res_adsi
-
- ASTERISK-19445: Incorrect values are specified as length in memcpy and
- memset
- Revision: 361210
- Reporter: makoto
- Coders: Makoto
-
- Category: Resources/res_crypto
-
- ASTERISK-19445: Incorrect values are specified as length in memcpy and
- memset
- Revision: 361210
- Reporter: makoto
- Coders: Makoto
-
- ----------------------------------------------------------------------
-
- 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 MusicOnHold in MeetMe so that it| |
- |361269 |jrose |always uses the class if it's been | |
- | | |defined | |
- |--------+----------+------------------------------------+---------------|
- |361380 |russell |Remove a few more files related to | |
- | | |chan_usbradio and app_rpt. | |
- |--------+----------+------------------------------------+---------------|
- |361403 |pabelanger|Fix typo in svn:keywords | |
- |--------+----------+------------------------------------+---------------|
- |361412 |pabelanger|Fix typo in svn:keywords | |
- |--------+----------+------------------------------------+---------------|
- |361471 |kmoore |Add missing newlines to CLI logging | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix memory leak when using | |
- |361558 |mjordan |MeetMeAdmin 'e' option with user | |
- | | |specified | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix memory leak in res_calendar_ews | |
- |361606 |mjordan |when event email address node is | |
- | | |empty | |
- |--------+----------+------------------------------------+---------------|
- |361657 |mjordan |Change SHARED function to use a safe| |
- | | |traversal when modifying a variable | |
- |--------+----------+------------------------------------+---------------|
- | | |Prevent invalid access of free'd | |
- |361705 |mjordan |memory if DAHDI channel during an | |
- | | |MWI event | |
- |--------+----------+------------------------------------+---------------|
- | | |Allow func_curl to exit gracefully | |
- |361753 |mjordan |if list allocation fails during | |
- | | |write | |
- |--------+----------+------------------------------------+---------------|
- |361803 |mjordan |Fix crash caused by unloading or | |
- | | |reloading of res_http_post | |
- |--------+----------+------------------------------------+---------------|
- | | |Prevent invalid access of free'd | |
- |361854 |rmudgett |memory if DAHDI channel during an | |
- | | |MWI event | |
- |--------+----------+------------------------------------+---------------|
- | | |Send relative path named recordings | |
- |362079 |jrose |to the meetme directory instead of | |
- | | |sounds | |
- |--------+----------+------------------------------------+---------------|
- | | |Check for IO stream failures in | |
- |362151 |mjordan |various format's truncate/seek |ASTERISK-19655 |
- | | |operations | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix handling of negative return code| |
- |362201 |mjordan |when storing voicemails in ODBC |ASTERISK-19655 |
- | | |storage | |
- |--------+----------+------------------------------------+---------------|
- |362204 |mjordan |Fix negative return handling in |ASTERISK-19655 |
- | | |channel drivers | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix error that caused seek format | |
- |362304 |mjordan |operations to set max file size to |ASTERISK-19655 |
- | | |'1' or '0' | |
- |--------+----------+------------------------------------+---------------|
- | | |Make use of va_args more appropriate| |
- |362354 |jrose |to form in various res_config |ASTERISK-19451 |
- | | |modules plus utils. | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix places where a negative return | |
- |362355 |mjordan |from ftello could be used as invalid|ASTERISK-19655 |
- | | |input | |
- |--------+----------+------------------------------------+---------------|
- |362359 |mjordan |Fix places in main where a negative |ASTERISK-19655 |
- | | |return value could impact execution | |
- |--------+----------+------------------------------------+---------------|
- | | |Fix places in resources where a | |
- |362362 |mjordan |negative return value could impact |ASTERISK-19655 |
- | | |execution | |
- |--------+----------+------------------------------------+---------------|
- | | |Handle case where an unknown format | |
- |362368 |mjordan |is used to get the preferred codec |ASTERISK-19655 |
- | | |size | |
- |--------+----------+------------------------------------+---------------|
- |362428 |rmudgett |Add ability to ignore layer 1 alarms| |
- | | |for BRI PTMP lines. | |
- |--------+----------+------------------------------------+---------------|
- |362485 |mjordan |Fix a variety of potential buffer |ASTERISK-19668 |
- | | |overflows | |
- |--------+----------+------------------------------------+---------------|
- |362586 |seanbright|Prevent a crash in ExternalIVR when |ASTERISK-17889 |
- | | |the 'S' command is sent first. | |
- |--------+----------+------------------------------------+---------------|
- |362677 |rmudgett |Update membermacro and membergosub | |
- | | |documentation in queues.conf.sample.| |
- |--------+----------+------------------------------------+---------------|
- |362680 |elguero |Add leading and trailing backslashes| |
- |--------+----------+------------------------------------+---------------|
- |362729 |wdoekes |Fix documentation for | |
- | | |${VERSION(ASTERISK_VERSION_NUM)}. | |
- |--------+----------+------------------------------------+---------------|
- |362815 |twilson |Document Speech* apps hangup on | |
- | | |failure and suggest TryExec | |
- |--------+----------+------------------------------------+---------------|
- |362997 |rmudgett |Update app_dial M and U option GOTO | |
- | | |return value documentation. | |
- |--------+----------+------------------------------------+---------------|
- | | |On some platforms, O_RDONLY is not a| |
- |363209 |tilghman |flag to be checked, but merely the | |
- | | |absence of O_RDWR and O_WRONLY. | |
- |--------+----------+------------------------------------+---------------|
- |363375 |rmudgett |Hangup affected channel in error | |
- | | |paths of bridge_call_thread(). | |
- |--------+----------+------------------------------------+---------------|
- |363687 |rmudgett |Clear ISDN channel resetting state |ASTERISK-19608 |
- | | |if the peer continues to use it. | |
- |--------+----------+------------------------------------+---------------|
- |363788 |rmudgett |Update Pickup application | |
- | | |documentation. | |
- |--------+----------+------------------------------------+---------------|
- |363875 |rmudgett |Update Pickup application | |
- | | |documentation. (Even better) | |
- |--------+----------+------------------------------------+---------------|
- |363934 |alecdavis |chan_sip: [general] maxforwards, not| |
- | | |checked for a value greater than 255| |
- |--------+----------+------------------------------------+---------------|
- |364046 |twilson |Add more constness to the end_buf |ASTERISK-18308 |
- | | |pointer in the netconsole | |
- |--------+----------+------------------------------------+---------------|
- | | |Update Pickup application | |
- |364108 |rmudgett |documentation. (With feeling this | |
- | | |time.) | |
- |--------+----------+------------------------------------+---------------|
- |364203 |mjordan |Allow for reloading SRTP crypto keys|ASTERISK-19253 |
- | | |within the same SIP dialog | |
- |--------+----------+------------------------------------+---------------|
- |364340 |twilson |Fix ast_parse_arg numeric type range| |
- | | |checking and add tests | |
- |--------+----------+------------------------------------+---------------|
- |364578 |mjordan |Fix error that caused truncate |ASTERISK-19655,|
- | | |operations to fail |ASTERISK-19810 |
- |--------+----------+------------------------------------+---------------|
- |364649 |may |Fix use freed pointer in return |ASTERISK-19663 |
- | | |value from call thread | |
- |--------+----------+------------------------------------+---------------|
- | | |Revert improved identities sent in | |
- |364706 |mmichelson|dialog-info NOTIFY requests in |ASTERISK-16735 |
- | | |r360862 | |
- |--------+----------+------------------------------------+---------------|
- |364840 |rmudgett |* Fix error path resouce leak in | |
- | | |local_request(). | |
- |--------+----------+------------------------------------+---------------|
- |364841 |qwell |Prevent a potential crash when using| |
- | | |manager hooks. | |
- |--------+----------+------------------------------------+---------------|
- |365006 |twilson |Fix a CEL LINKEDID_END race and | |
- | | |local channel linkedids | |
- |--------+----------+------------------------------------+---------------|
- |365068 |twilson |Don't leak a ref if out of memory | |
- | | |and can't link the linkedid | |
- |--------+----------+------------------------------------+---------------|
- |367959 |bebuild |Create 1.8.13.0-rc2 | |
- |--------+----------+------------------------------------+---------------|
- |367965 |bebuild |Merge r367781,367843,367266 for | |
- | | |1.8.13.0-rc2 | |
- |--------+----------+------------------------------------+---------------|
- |367971 |bebuild |Importing release summary for | |
- | | |1.8.13.0-rc2 release. | |
- +------------------------------------------------------------------------+
-
- ----------------------------------------------------------------------
-
- 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 | 21 +
- Makefile | 47 --
- Makefile.rules | 4
- addons/chan_mobile.c | 6
- addons/ooh323cDriver.c | 5
- apps/app_chanspy.c | 8
- apps/app_confbridge.c | 11
- apps/app_dial.c | 14
- apps/app_directed_pickup.c | 49 +-
- apps/app_externalivr.c | 16
- apps/app_forkcdr.c | 11
- apps/app_ices.c | 2
- apps/app_meetme.c | 45 ++
- apps/app_sms.c | 12
- apps/app_speech_utils.c | 9
- apps/app_voicemail.c | 16
- apps/rpt_flow.pdf | 576 ----------------------------
- asterisk-1.8.13.0-rc1-summary.html | 434 ---------------------
- asterisk-1.8.13.0-rc1-summary.txt | 584 -----------------------------
- asterisk-1.8.13.0-rc2-summary.html | 62 +++
- asterisk-1.8.13.0-rc2-summary.txt | 92 ++++
- build_tools/cflags.xml | 5
- build_tools/menuselect-deps.in | 1
- channels/chan_agent.c | 2
- channels/chan_dahdi.c | 82 +++-
- channels/chan_gtalk.c | 14
- channels/chan_iax2.c | 39 +
- channels/chan_local.c | 35 +
- channels/chan_mgcp.c | 2
- channels/chan_sip.c | 108 ++---
- channels/chan_skinny.c | 60 ++-
- channels/chan_unistim.c | 13
- channels/console_gui.c | 6
- channels/console_video.c | 2
- channels/sig_pri.c | 97 +++-
- channels/sig_pri.h | 28 +
- codecs/gsm/Makefile | 43 --
- codecs/gsm/src/k6opt.s | 739 -------------------------------------
- codecs/lpc10/Makefile | 26 -
- configs/chan_dahdi.conf.sample | 12
- configs/queues.conf.sample | 10
- configs/rpt.conf.sample | 193 ---------
- configs/usbradio.conf.sample | 61 ---
- configure.ac | 15
- formats/format_g719.c | 28 +
- formats/format_g723.c | 15
- formats/format_g729.c | 15
- formats/format_gsm.c | 55 ++
- formats/format_h263.c | 15
- formats/format_h264.c | 15
- formats/format_ilbc.c | 15
- formats/format_ogg_vorbis.c | 2
- formats/format_pcm.c | 65 ++-
- formats/format_siren14.c | 29 +
- formats/format_siren7.c | 29 +
- formats/format_sln.c | 36 +
- formats/format_sln16.c | 29 +
- formats/format_vox.c | 66 ++-
- formats/format_wav.c | 39 +
- formats/format_wav_gsm.c | 37 +
- funcs/func_channel.c | 2
- funcs/func_curl.c | 1
- funcs/func_devstate.c | 2
- funcs/func_env.c | 34 +
- funcs/func_global.c | 5
- funcs/func_strings.c | 4
- funcs/func_sysinfo.c | 2
- funcs/func_version.c | 3
- funcs/func_volume.c | 2
- include/asterisk/time.h | 5
- main/app.c | 2
- main/asterisk.c | 62 ++-
- main/astfd.c | 4
- main/astobj2.c | 5
- main/cdr.c | 2
- main/cel.c | 98 ++--
- main/config.c | 126 ++++--
- main/features.c | 241 ++++++------
- main/frame.c | 10
- main/http.c | 12
- main/jitterbuf.c | 8
- main/logger.c | 3
- main/manager.c | 97 +++-
- main/pbx.c | 4
- main/stdtime/localtime.c | 6
- main/tcptls.c | 2
- main/tdd.c | 28 -
- main/translate.c | 33 +
- main/utils.c | 2
- main/xmldoc.c | 2
- makeopts.in | 1
- res/res_agi.c | 12
- res/res_calendar_ews.c | 2
- res/res_clioriginate.c | 1
- res/res_config_curl.c | 7
- res/res_config_odbc.c | 73 ++-
- res/res_config_pgsql.c | 12
- res/res_config_sqlite.c | 2
- res/res_fax.c | 2
- res/res_musiconhold.c | 2
- res/res_rtp_asterisk.c | 5
- res/res_srtp.c | 2
- tests/test_config.c | 286 ++++++++++++++
- tests/test_linkedlists.c | 2
- tests/test_poll.c | 2
- utils/extconf.c | 2
- 107 files changed, 1961 insertions(+), 3368 deletions(-)
-
- ----------------------------------------------------------------------
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/.version
^
|
@@ -1 +1 @@
-1.8.13.0
+1.8.14.1
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/ChangeLog
^
|
@@ -1,3 +1,753 @@
+2102-07-16 Asterisk Development Team <asteriskteam@digium.com>
+
+ * Asterisk 1.8.14.1 Released.
+
+ * Remove a superfluous and dangerous freeing of an SSL_CTX that could
+ lead to a crash in tcptls
+
+ The problem here is that multiple server sessions share a SSL_CTX.
+ When on session ended, the SSL_CTX would be freed and set NULL,
+ leaving the other sessions unable to function.
+
+ The code being removed is superfluous because the SSL_CTX structures
+ for servers will be properly freed when ast_ssl_teardown is called.
+
+ (closes issue ASTERISK-20074)
+
+2012-07-10 Asterisk Development Team <asteriskteam@digium.com>
+
+ * Asterisk 1.8.14.0 Released.
+
+2012-07-06 Asterisk Development Team <asteriskteam@digium.com>
+
+ * Asterisk 1.8.14.0-rc2 Released.
+
+ * AST-2012-010: Possible Resource Leak on Uncompleted Re-INVITE
+ transactions
+
+ * AST-2012-011: Remote Crash Vulnerability in VoiceMail Application
+
+ * Fix crash on a guest directmedia call
+
+ A sip_pvt may not have relatedpeer set if a call doesn't match up
+ with a peer. If there is no relatedpeer, there is no direct media
+ ACL to apply, so just return that is is allowed.
+
+ (closes issue ASTERISK-20040)
+
+ * Fix request routing issue when outboundproxy is used
+
+ Asterisk was incorrectly setting the destination of CANCELs and ACKs
+ for error responses to the URI of the initial INVITE. This resulted
+ in further requests, such as INVITEs with authentication
+ credentials, to be routed incorrectly. Instead when these CANCEL or
+ ACKs are to be esnt, we should simply keep the destination the same
+ as what it previously was. There is no need to alter it any.
+
+ (closes issue ASTERISK-20008)
+
+ * Fix monitoring calls put in a parking lot
+
+ Fix a regression that was introduced by r366167 which effectively
+ disabled monitoring parked calls.
+
+ (closes issue ASTERISK-20012)
+
+2012-06-08 Asterisk Development Team <asteriskteam@digium.com>
+
+ * Asterisk 1.8.14.0-rc1 Released.
+
+2012-06-06 21:27 +0000 [r368644] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c, channels/sig_analog.c: Fix POTS flash hook
+ to orignate a second call deadlock. A deadlock can occur when a
+ POTS phone tries to flash hook to originate a second call for
+ 3-way or transfer. If another process is scanning the channels
+ container when the POTS line flash hooks then a deadlock will
+ occur. * Release the channel and private locks when creating a
+ new channel as a result of a flash hook. (closes issue
+ ASTERISK-19842) Reported by: rmudgett Tested by: rmudgett
+
+2012-06-06 19:13 +0000 [r368625] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Fix a specific scenario where ACKs are not
+ matched. If a dialog-starting INVITE contains a to-tag, then
+ Asterisk will respond with a 481. In this case, the resulting
+ incoming ACK would not be matched, so Asterisk would continue
+ retransmitting the 481 until the transaction times out. There
+ were two issues. Asterisk, upon creating a sip_pvt would generate
+ a local tag. However, when the time came to transmit the 481,
+ since there was a to-tag in the INVITE, Asterisk would place this
+ original to-tag in the 481 response. When the ACK came in,
+ Asterisk would attempt to match the to-tag in the ACK to the
+ generated local tag. Unfortunately, Asterisk never actually
+ transmitted a response with the generated local tag, so the
+ to-tag in the ACK would not match. The other problem was that
+ when the 481 was sent, nothing was set on the sip_pvt to indicate
+ what CSeq is expected in the ACK. To fix the first problem, we
+ zero out the to-tag seen in the incoming INVITE. This way,
+ Asterisk, when time to send a response, will send its generated
+ local tag instead. To fix the second problem, we set the
+ sip_pvt's pendinginvite to the CSeq of the INVITE when we send a
+ 481. (closes issue ASTERISK-19892) Reported by Mark Michelson
+
+2012-06-06 17:20 +0000 [r368604] Matthew Jordan <mjordan@digium.com>
+
+ * build_tools/make_version: Add feature modifier to versions
+ produced from branches Certain branches, such as Certified
+ Asterisk, may have a modifier added to them that specifies the
+ features available in that branch. For branches, this modifier is
+ expected to be reflected in the location of the branch in
+ subversion. For example, a subversion of URL of
+ /certified/branches/1.8.11 would have a feature modifier of
+ 'certified'. This is slightly different then how features are
+ determined for tags, where the feature is part of the actual tag
+ name, e.g., "10.5.0-digiumphones". In keeping with the
+ nomenclature used for tags, the feature specifier for branches is
+ translated and placed after the revision numbers. For the example
+ given previously, this would result in a branch version of
+ "Asterisk SVN-branch-1.8.11-cert-rXXXXXX".
+
+2012-06-06 16:07 +0000 [r368586] Kinsey Moore <kmoore@digium.com>
+
+ * channels/chan_sip.c: Ensure overlapping hold flags do not
+ conflict When changing between different modes of hold, the flags
+ were not being cleared out properly causing a failure to change
+ hold states. (closes issue ASTERISK-19919) Patch-by: Morten
+ Tryfoss Reported-by: Morten Tryfoss
+
+2012-06-06 01:08 +0000 [r368567] Richard Mudgett <rmudgett@digium.com>
+
+ * main/features.c: Fix parked call performing a DTMF blind transfer
+ after being retrieved. When a parked call was retrieved from the
+ parking lot, it could not do a blind transfer because it caused
+ the involved calls to be hung up unconditionally. * Made the
+ ParkedCall application return the ast_bridge_call() return value.
+ (closes issue ABE-2862) Reported by: Vlad Povorozniuc
+
+2012-06-05 15:26 +0000 [r368520-368533] Kinsey Moore <kmoore@digium.com>
+
+ * apps/app_minivm.c: Resolve some build warnings My newly upgraded
+ compiler caught these usages of uninitialized values. They
+ weren't actually used.
+
+ * apps/app_voicemail.c: Ensure that pages and emails are sent using
+ RFC822-compliant date format When localization was added to
+ app_voicemail, these headers were altered when they should have
+ remained in en_US format for RFC compliance. This reverts the
+ changes to those two lines. (closes issue ASTERISK-19876)
+
+2012-06-04 21:56 +0000 [r368498] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Relay proper SIP responses on calling side.
+ Revision 351130 broke corect HANGUPCAUSE setting for the 404 case
+ in chan_sip. Other cases were also potentially broken. This patch
+ fixes the relaying of causes to be what they used to be. (closes
+ issue ASTERISK-19914) Reported by Pavel Troller Tested by Walter
+ Doekes (via a reviewboard test to be committed later) Patches:
+ chan_sip.diff uploaded by Pavel Troller (license #6302)
+
+2012-06-04 21:10 +0000 [r368405-368469] Richard Mudgett <rmudgett@digium.com>
+
+ * UPGRADE.txt: Document BLINDTRANSFER behavior change. (issue
+ ASTERISK-19322) (closes issue ASTERISK-19875) Reported by: call
+
+ * main/channel.c: Fix potential deadlock between masquerade and
+ chan_local. * Restructure ast_do_masquerade() to not hold channel
+ locks while it calls ast_indicate(). * Simplify many calls to
+ ast_do_masquerade() since it will never return a failure now. If
+ it does fail internally because a channel driver callback
+ operation failed, the only thing ast_do_masquerade() can do is
+ generate a warning message about strange things may happen and
+ press on. * Fixed the call to ast_bridged_channel() in
+ ast_do_masquerade(). This change fixes half of the deadlock
+ reported in ASTERISK-19801 between masquerades and chan_iax.
+ (closes issue ASTERISK-19537) Reported by: rmudgett Tested by:
+ rmudgett Review: https://reviewboard.asterisk.org/r/1915/
+
+2012-06-01 23:21 +0000 [r368308] Richard Mudgett <rmudgett@digium.com>
+
+ * apps/app_stack.c: Fix deadlock when Gosub used with alternate
+ dialplan switches. Attempting to remove a channel from
+ autoservice with the channel lock held will result in deadlock. *
+ Restructured gosub_exec() to not call ast_parseable_goto() and
+ ast_exists_extension() with the channel lock held. (closes issue
+ ASTERISK-19764) Reported by: rmudgett Tested by: rmudgett
+
+2012-06-01 18:18 +0000 [r368218] Kevin P. Fleming <kpfleming@digium.com>
+
+ * channels/chan_sip.c: Improve SDP parsing warning messages *
+ 'Unsupported media type' is only reported when that is in fact
+ the case, not when a supported media type is included in an 'm'
+ line that has an invalid format. * All warning messages related
+ to parsing 'm' lines now include the 'm' line contents. * (minor
+ bugfix) newline added to port-number-zero warning messages. *
+ Warning messages improved to use RFC-specified terminology for
+ various items. * Warnings for offers that include more than one
+ port for a single media type now include the media type. Review:
+ https://reviewboard.asterisk.org/r/1811/
+
+2012-06-01 03:25 +0000 [r368092] Michael L. Young <elgueromexicano@gmail.com>
+
+ * funcs/func_channel.c: Add documentation to function CHANNEL for
+ options echocan_mode and buffers The ability to set
+ "echocan_mode" and "buffers" through the dialplan was added to
+ chan_dahdi some time ago. This patch adds some documentation to
+ func_channel. (Closes issue ASTERISK-19911) Reported by: Dale
+ Noll Tested by: Michael L. Young Patches:
+ asterisk-19911-branch18.diff uploaded by Michael L. Young
+ (license 5026) Review: https://reviewboard.asterisk.org/r/1949/
+
+2012-05-31 18:00 +0000 [r367906-368039] Richard Mudgett <rmudgett@digium.com>
+
+ * main/db1-ast/btree/bt_open.c, apps/app_queue.c,
+ channels/chan_iax2.c, pbx/pbx_config.c, res/ael/pval.c,
+ main/tcptls.c, main/manager.c, res/res_config_odbc.c,
+ channels/chan_sip.c, channels/chan_agent.c, funcs/func_math.c,
+ main/features.c: Coverity Report: Fix issues for error type
+ REVERSE_INULL (core modules) * Fixes findings:
+ 0-2,5,7-15,24-26,28-31 (issue ASTERISK-19648) Reported by: Matt
+ Jordan
+
+ * channels/sig_pri.c, channels/sig_ss7.c: Use the
+ DEADLOCK_AVOIDANCE() macro instead. (issue ASTERISK-19854)
+
+ * channels/sig_pri.c, channels/sig_ss7.c: Fix deadlock when
+ executing CLI "pri show channels" and "ss7 show channels"
+ commands. * Fix sig_pri_lock_owner() to avoid deadlock properly.
+ * Code pri_grab() better. * Fix sig_ss7_lock_owner() to avoid
+ deadlock properly. * Code ss7_grab() better. (closes issue
+ ASTERISK-19854) Reported by: Jaxon Patches:
+ jira_asterisk_19854_v1.8.6.patch (license #5621) patch uploaded
+ by rmudgett (Modified to do the same thing to sig_ss7) Tested by:
+ Jaxon
+
+ * apps/app_meetme.c: Coverity Report: Fix issues for error type
+ REVERSE_INULL (deprecated modules) * Fix only issue pointed out
+ by deprecated_REVERSE_INULL.txt for app_meetme.c in find_user().
+ * Change use of %i to %d in sscanf() in find_user(). The use of
+ %i gives unexpected parsing because it can accept hex, octal, and
+ decimal integer formats. * Changed other uses of %i in
+ app_meetme() to use %d for consistency. (issue ASTERISK-19648)
+ Reported by: Matt Jordan
+
+2012-05-29 18:30 +0000 [r367843] Matthew Jordan <mjordan@digium.com>
+
+ * channels/chan_skinny.c: AST-2012-008: Fix remote crash
+ vulnerability in chan_skinny When a skinny session is
+ unregistered, the corresponding device pointer is set to NULL in
+ the channel private data. If the client was not in the on-hook
+ state at the time the connection was closed, the device pointer
+ can later be dereferenced if a message or channel event attempts
+ to use a line's pointer to said device. The patches prevent this
+ from occurring by checking the line's pointer in message handlers
+ and channel callbacks that can fire after an unregistration
+ attempt. (closes issue ASTERISK-19905) Reported by: Christoph
+ Hebeisen Tested by: mjordan, Damien Wedhorn Patches:
+ AST-2012-008-1.8.diff uploaded by mjordan (license 6283)
+ AST-2012-008-10.diff uploaded by mjordan (license 6283)
+
+2012-05-25 16:28 +0000 [r367781] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_iax2.c: AST-2012-007: Fix IAX receiving HOLD
+ without suggested MOH class crash. * Made schedule_delivery() set
+ the received frame f->data.ptr to NULL if the datalen is zero. *
+ Fix queue_signalling() memcpy() size error. * Made
+ queue_signalling() not use C++ keyword variable names. (closes
+ issue ASTERISK-19597) Reported by: mgrobecker Patches:
+ jira_asterisk_19597_v1.8.patch (license #5621) patch uploaded by
+ rmudgett Tested by: rmudgett, Michael L. Young
+
+2012-05-25 02:27 +0000 [r367730] Michael L. Young <elgueromexicano@gmail.com>
+
+ * channels/chan_sip.c: Fix pvt_sip for inbound call to use peer's
+ allowtransfer setting The pvt_sip allowtransfer was not being set
+ to that of the peer's setting. Therefore, the global
+ allowtransfer setting was being used instead which would lead to
+ calls not being transfered if the global setting was set to 'no'
+ despite the setting on the peer being 'yes' and vice versa, calls
+ would be allowed to transfer even if the peer's setting was 'no'
+ but the global setting was 'yes'. (Closes issue ASTERISK-19856)
+ Reported by: Jacek Tested by: Michael L. Young, Jacek Patches:
+ issue-asterisk-19856-branch10-v3.diff uploaded by Michael L.
+ Young (license 5026) Review:
+ https://reviewboard.asterisk.org/r/1923/
+
+2012-05-24 22:21 +0000 [r367469-367678] Richard Mudgett <rmudgett@digium.com>
+
+ * apps/app_queue.c, apps/app_dial.c: Fix Dial I option ignored if
+ dial forked and one fork redirects. The Dial and Queue I option
+ is intended to block connected line updates and redirecting
+ updates. However, it is a feature that when a call is locally
+ redirected, the I option is disabled if the redirected call runs
+ as a local channel so the administrator can have an opportunity
+ to setup new connected line information. Unfortunately, the Dial
+ and Queue I option is disabled for *all* forked calls if one of
+ those calls is redirected. * Make the Dial and Queue I option
+ apply to each outgoing call leg independently. Now if one
+ outgoing call leg is locally redirected, the other outgoing calls
+ are not affected. * Made Dial not pass any redirecting updates
+ when forking calls. Redirecting updates do not make sense for
+ this scenario. * Made Queue not pass any redirecting updates when
+ using the ringall strategy. Redirecting updates do not make sense
+ for this scenario. * Fixed deadlock potential with chan_local
+ when Dial and Queue send redirecting updates for a local
+ redirect. * Converted the Queue stillgoing flag to a boolean
+ bitfield. (closes issue ASTERISK-19511) Reported by: rmudgett
+ Tested by: rmudgett Review:
+ https://reviewboard.asterisk.org/r/1920/
+
+ * main/pbx.c: Fix WaitExten(x,m(musicclass)) string termination.
+ The AST_CONTROL_HOLD MOH class from the WaitExten application can
+ now be queued onto a channel, passed over local channels with the
+ /m option, and passed over IAX channels.
+
+2012-05-23 20:27 +0000 [r367416] Mark Michelson <mmichelson@digium.com>
+
+ * main/tcptls.c: Only call SSL_CTX_free if DO_SSL is defined.
+ Thanks to Paul Belanger for pointing out this error.
+
+2012-05-23 13:06 +0000 [r367362] Matthew Jordan <mjordan@digium.com>
+
+ * channels/chan_sip.c: Update a peer's LastMsgsSent when the peer
+ is notified of waiting messages Previously, MWI logic utilized a
+ counter called 'lastmsgssent' to know whether or not MWI NOTIFY
+ requests had been sent to a specific peer. When MWI notifications
+ were changed to use the internal event framework, this value was
+ no longer needed for its original purpose. Hence, it was no
+ longer updated with the new/old message counts for a peer.
+ However, the value was still presented when, either by AMI or
+ CLI, a 'sip show peer [peer]' command was executed. The output of
+ the command would always display the erroneous value of
+ 32767/65535 for 'LastMsgsSent'. This patch makes it so that the
+ value of lastmsgssent is updated appropriately. The value should
+ now display the new/old message counts for a particular peer.
+ (closes issue ASTERISK-17866) Reported by: Steve Davies patches
+ by: ast-17866-rb1272.patch (License #5041 by irroot) Modified
+ slightly for this commit Review:
+ https://reviewboard.asterisk.org/r/1939
+
+2012-05-22 17:14 +0000 [r367266-367292] Terry Wilson <twilson@digium.com>
+
+ * include/asterisk/channel.h, main/cel.c, main/asterisk.c,
+ main/channel.c, include/asterisk/cel.h: Fix race condition for
+ CEL LINKEDID_END event This patch fixes to situations that could
+ cause the CEL LINKEDID_END event to be missed. 1) During a core
+ stop gracefully, modules are unloaded when ast_active_channels ==
+ 0. The LINKDEDID_END event fires during the channel destructor.
+ This means that occasionally, the cel_* module will be unloaded
+ before the channel is destroyed. It seemed generally useful to
+ wait until the refcount of all channels == 0 before unloading, so
+ I added a channel counter and used it in the shutdown code. 2)
+ During a masquerade, ast_channel_change_linkedid is called. It
+ calls ast_cel_check_retire_linkedid which unrefs the linkedid in
+ the linkedids container in cel.c. It didn't ref the new linkedid.
+ Now it does. Review: https://reviewboard.asterisk.org/r/1900/
+
+ * channels/chan_sip.c: Resolve crash in subscribing for MWI
+ notifications ASTOBJ_UNREF sets the variable to NULL after
+ unreffing it, so the variable should definitely not be used after
+ that. To solve this in the two cases that affect subscribing for
+ MWI notifications, we instead save the ref locally, and unref
+ them in the error conditions. (closes issue ASTERISK-19827)
+ Reported by: B. R Review:
+ https://reviewboard.asterisk.org/r/1940/
+
+2012-05-18 17:47 +0000 [r367002-367027] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_dahdi.c, main/say.c: Address MISSING_BREAK static
+ analysis reports some more. This addresses core findings 4 and 6.
+ Moises Silva helped me by stating that a break could be safely
+ added to the case where it is added in chan_dahdi.c In say.c, I
+ have added a comment indicating that static analysis complains
+ but that it is currently unknown if this is correct. This fixes
+ all core findings of this type. (closes issue ASTERISK-19662)
+ reported by Matthew Jordan
+
+ * include/asterisk/tcptls.h, main/tcptls.c, channels/chan_sip.c:
+ Fix memory leak of SSL_CTX structures in TLS core. SSL_CTX
+ structures were allocated but never freed. This was a bigger
+ issue for clients than servers since new SSL_CTX structures could
+ be allocated for each connection. Servers, on the other hand,
+ typically set up a single SSL_CTX for their lifetime. This is
+ solved in two ways: 1. In __ssl_setup(), if a tcptls_cfg has an
+ ssl_ctx on it, it is freed so that a new one can take its place.
+ 2. A companion to ast_ssl_setup() called ast_ssl_teardown() has
+ been added so that servers can properly free their SSL_CTXs.
+ (issue ASTERISK-19278)
+
+2012-05-18 15:42 +0000 [r366944] Matthew Jordan <mjordan@digium.com>
+
+ * main/cli.c, channels/chan_sip.c, funcs/func_odbc.c: Fix more
+ memory leaks This patch adds to what was fixed in r366880.
+ Specifically, it addresses the following: * chan_sip: dispose of
+ an allocated frame in off nominal code paths in sip_rtp_read *
+ func_odbc: when disposing of an allocated resultset, ensure that
+ any rows that were appended to that resultset are also disposed
+ of * cli: free the created return string buffer in another off
+ nominal code path (issue ASTERISK-19665) Reported by: Matt Jordan
+ Review: https://reviewboard.asterisk.org/r/1922/
+
+2012-05-18 14:16 +0000 [r366882] Kinsey Moore <kmoore@digium.com>
+
+ * channels/sip/config_parser.c: Reorder and renumber tests
+ appropriately It appears that a patch did not apply properly when
+ adding tests 12 and 13 and test 11 was duplicated. These tests
+ have been reordered and renumbered such that they make sense.
+
+2012-05-18 13:58 +0000 [r366880] Matthew Jordan <mjordan@digium.com>
+
+ * res/res_calendar_caldav.c, res/res_musiconhold.c,
+ res/res_jabber.c, apps/app_queue.c, channels/chan_iax2.c,
+ main/enum.c, main/editline/term.c, main/config.c, res/res_srtp.c,
+ main/editline/tokenizer.c, main/cli.c, channels/chan_dahdi.c,
+ main/data.c, funcs/func_odbc.c, apps/app_minivm.c,
+ main/features.c, main/editline/readline.c,
+ channels/sip/config_parser.c, main/xmldoc.c, res/res_calendar.c,
+ apps/app_voicemail.c, res/res_rtp_asterisk.c, main/netsock2.c,
+ res/res_calendar_icalendar.c, res/res_calendar_exchange.c,
+ main/pbx.c, apps/app_page.c, channels/chan_sip.c,
+ funcs/func_dialgroup.c, apps/app_record.c: Fix a variety of
+ memory leaks This patch addresses a number of memory leaks in a
+ variety of modules that were found by a static analysis tool. A
+ brief summary of the changes: * app_minivm: free ast_str objects
+ on off nominal paths * app_page: free the ast_dial object if the
+ requested channel technology cannot be appended to the dialing
+ structure * app_queue: if a penalty rule failed to match any
+ existing rule list names, the created rule would not be inserted
+ and its memory would be leaked * app_read: dispose of the created
+ silence detector in the presence of off nominal circumstances *
+ app_voicemail: dispose of an allocated unique ID field for MWI
+ event un-subscribe requests in off nominal paths; dispose of
+ configuration objects when using the secret.conf option *
+ chan_dahdi: dispose of the allocated frame produced by
+ ast_dsp_process * chan_iax2: properly unref peer in CLI command
+ "iax2 unregister" * chan_sip: dispose of the allocated frame
+ produced by sip_rtp_read's call of ast_dsp_process; free memory
+ in parse unit tests * func_dialgroup: properly deref ao2 object
+ grhead in nominal path of dialgroup_read * func_odbc: free
+ resultset in off nominal paths of odbc_read * cli: free
+ match_list in off nominal paths of CLI match completion * config:
+ free comment_buffer/list_buffer when configuration file load is
+ unchanged; free the same buffers any time they were created and
+ config files were processed * data: free XML nodes in various
+ places * enum: free context buffer in off nominal paths *
+ features: free ast_call_feature in off nominal paths of
+ applicationmap config processing * netsock2: users of
+ ast_sockaddr_resolve pass in an ast_sockaddr struct that is
+ allocated by the method. Failures in ast_sockaddr_resolve could
+ result in the users of the method not knowing whether or not the
+ buffer was allocated. The method will now not allocate the
+ ast_sockaddr struct if it will return failure. * pbx: cleanup
+ hash table traversals in off nominal paths; free ignore pattern
+ buffer if it already exists for the specified context * xmldoc:
+ cleanup various nodes when we no longer need them *
+ main/editline: various cleanup of pointers not being freed before
+ being assigned to other memory, cleanup along off nominal paths *
+ menuselect/mxml: cleanup of value buffer for an attribute when
+ that attribute did not specify a value * res_calendar*: responses
+ are allocated via the various *_request method returns and should
+ not be allocated in the various write_event methods; ensure
+ attendee buffer is freed if no data exists in the parsed node;
+ ensure that calendar objects are de-ref'd appropriately *
+ res_jabber: free buffer in off nominal path * res_musiconhold:
+ close the DIR* object in off nominal paths * res_rtp_asterisk: if
+ we run out of ports, close the rtp socket object and free the rtp
+ object * res_srtp: if we fail to create the session in libsrtp,
+ destroy the temporary ast_srtp object (issue ASTERISK-19665)
+ Reported by: Matt Jordan Review:
+ https://reviewboard.asterisk.org/r/1922
+
+2012-05-17 14:40 +0000 [r366791] Jonathan Rose <jrose@digium.com>
+
+ * channels/chan_sip.c: chan_sip: Fix missed locking of opposing pvt
+ for directmedia acl from r366547 It also required deadlock
+ avoidance since two sip_pvts structs needed to be locked
+ simultaneously. Trunk handles it differently, so this is a 1.8
+ and 10 patch only. (issue AST-876)
+
+2012-05-17 12:51 +0000 [r366740] Matthew Jordan <mjordan@digium.com>
+
+ * res/res_calendar_ews.c, channels/chan_dahdi.c: Fix checking
+ bounds of array index after using it; improper sizeof This patch
+ fixes two problems pointed out by a static analysis tool. * In
+ chan_dahdi, when an event is handled the index of the sub channel
+ is first obtained. In very off nominal cases, the method that
+ determines the index can return a negative value. In the event
+ handling code, whether or not the index returned is valid was
+ being checked after that value was used to index into an array.
+ This patch makes it so the value is checked before any indexing
+ is done. * In res_calendar_ews, sizeof was being passed a pointer
+ instead of the struct to determine the amount of memory to
+ allocate. (issue ASTERISK-19651) Reported by: Matt Jordan (closes
+ issue ASTERISK-19671) Reported by: Matt Jordan
+
+2012-05-16 15:52 +0000 [r366597-366650] Mark Michelson <mmichelson@digium.com>
+
+ * main/http.c: Fix incorrect default port number for HTTP server.
+ Thanks to Tzafrir Cohen for bringing this up on the Asterisk
+ developers mailing list.
+
+ * channels/chan_sip.c: Correct misuse of ast_strip_quoted() when
+ getting a Diversion header's reason parameter. The use here was
+ assuming that the pointer would be updated, but the updated
+ string is actually returned by ast_strip_quoted() instead.
+
+2012-05-15 20:14 +0000 [r366547] Jonathan Rose <jrose@digium.com>
+
+ * channels/chan_sip.c: chan_sip: Check the right channel's host
+ address for directmediapermit/deny Prior to this patch, when
+ checking the addresses for directmediapermit and directmediadeny,
+ Asterisk would check the host address of the channel permit/deny
+ was specified, which differs from the expectations of both our
+ users and the development team. Instead, directmediapermit/deny
+ now checks against the address of the channel that the peer with
+ the ACL is connected to. (issue AST-876) Review:
+ https://reviewboard.asterisk.org/r/1899/
+
+2012-05-14 19:57 +0000 [r366389-366409] Mark Michelson <mmichelson@digium.com>
+
+ * pbx/dundi-parser.c: Fix two more coverity constant expression
+ result findings. These correspond to findings 0 and 1 in the core
+ findings of ASTERISK-19649. After contacting Mark Spencer, he was
+ unsure of what the intent behind these lines of code were, so
+ they are being axed. For Asterisk 1.8 and 10, the output of
+ debugging DUNDi frames will not be changed, but for trunk the
+ "Retry" portion will be omitted since it does not properly
+ distinguish retransmissions from initial frames. (closes issue
+ ASTERISK-19649) Reported by Matthew Jordan
+
+ * channels/chan_sip.c: Fix broken reinvite glare scenario. To make
+ a long story short, reinvite glares were broken because Asterisk
+ would invert the To and From headers when ACKing a 491 response.
+ The reason was because the initreq of the dialog was being
+ changed to the incoming glared reinvite instead of being set to
+ the outgoing glared reinvite. This change has three parts * In
+ handle_incoming, we never will reject an ACK because it has a
+ to-tag present, even if we think the request may be out of
+ dialog. * In handle_request_invite, we do not change the initreq
+ when receiving a reinvite to which we will respond with a 491. *
+ In handle_request_invite, several superflous settings up
+ pendinginvite have been removed since this is dones automatically
+ by transmit_response_reliable Review:
+ https://reviewboard.asterisk.org/r/1911
+
+2012-05-11 23:53 +0000 [r366296] Russell Bryant <russell@russellbryant.com>
+
+ * addons/format_mp3.c: format_mp3: Fix a possible crash mp3_read().
+ This patch fixes a potential crash in mp3_read() by not assuming
+ that dbuf has enough data to finish filling up the output buffer.
+ The patch also makes sure that the dbuf state gets reset after we
+ know we read everything out of it already. In passing, this patch
+ includes some other cleanups of this module, including stripping
+ trailing whitespace, formatting fixes based on coding guidelines,
+ and removing a number of unused members from the private state
+ struct. (closes issue ASTERISK-19761) Reported by: Chris
+ Maciejewsk Tested by: Chris Maciejewsk
+
+2012-05-10 23:38 +0000 [r366240] Richard Mudgett <rmudgett@digium.com>
+
+ * main/channel.c: * Made ast_change_name() hold the channels
+ container lock while changing the channel name. * Eliminate
+ redundant list not empty check in clone_variables().
+
+2012-05-10 20:50 +0000 [r366167] Kinsey Moore <kmoore@digium.com>
+
+ * main/devicestate.c, pbx/dundi-parser.c, channels/chan_iax2.c,
+ channels/iax2-parser.c, main/config.c, res/res_monitor.c,
+ main/channel.c, main/cdr.c, res/ael/pval.c, main/data.c,
+ channels/chan_dahdi.c, main/tcptls.c, main/manager.c,
+ main/features.c, main/app.c, main/event.c, pbx/pbx_dundi.c,
+ res/res_odbc.c, main/xmldoc.c, apps/app_voicemail.c,
+ funcs/func_speex.c, main/pbx.c, res/res_calendar_icalendar.c,
+ channels/chan_sip.c, funcs/func_lock.c, channels/chan_agent.c,
+ channels/sip/reqresp_parser.c: Resolve FORWARD_NULL static
+ analysis warnings This resolves core findings from ASTERISK-19650
+ numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56,
+ 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding
+ numbers 26, 33, and 29 were already resolved. Those skipped were
+ either extended/deprecated or in areas of code that shouldn't be
+ disturbed. (Closes issue ASTERISK-19650)
+
+2012-05-10 16:47 +0000 [r366094] Jonathan Rose <jrose@digium.com>
+
+ * channels/iax2-provision.c, apps/app_queue.c,
+ channels/chan_iax2.c, res/ael/ael.flex, funcs/func_devstate.c,
+ main/asterisk.c, main/db.c, main/xmldoc.c, apps/app_voicemail.c,
+ main/pbx.c, channels/sig_analog.c, channels/chan_sip.c,
+ funcs/func_lock.c, main/features.c, main/acl.c: Coverity Report:
+ Fix issues for error type CHECKED_RETURN for core (issue
+ ASTERISK-19658) Reported by: Matt Jordan Review:
+ https://reviewboard.asterisk.org/r/1905/
+
+2012-05-10 16:10 +0000 [r366052] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Close the proper tcptls_session when session
+ creation fails. (issue AST-998) Reported by: Thomas Arimont
+ Tested by: Thomas Arimont
+
+2012-05-10 15:35 +0000 [r365989-366048] Jonathan Rose <jrose@digium.com>
+
+ * apps/app_chanspy.c, apps/app_page.c, funcs/func_cdr.c,
+ main/features.c, apps/app_disa.c: Coverity Report: Fix issues for
+ error type UNINIT in Core supported modules (issue
+ ASTERISK-19652) Reported by: Matt Jordan Review:
+ https://reviewboard.asterisk.org/r/1909/
+
+ * codecs/codec_dahdi.c: Block on frameout if the hardware has
+ enough samples to complete a frame. Fixes some problems with
+ skipping audio in elaborate scenarios involving multiple codecs
+ by making codec_dahdi operate in a more synchronous fashion
+ similar to codec_g729. This change also fixes the use of file
+ conversion tools from Asterisk's CLI. This change may cause the
+ thread responsible for transcoding audio to block briefly (Shaun
+ Ruffell describes this as 'several milliseconds') while waiting
+ for the hardware transcoder. (closes issue ASTERISK-19643)
+ reported by: Shaun Ruffell Patches:
+ 0001-codec_dahdi-Block-on-frameout-the-hardware-has-enoug.patch
+ uploaded by Shaun Ruffell (license 5417)
+
+2012-05-09 16:11 +0000 [r365896] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Prevent sip_pvt refleak when an ast_channel
+ outlasts its corresponding sip_pvt. chan_sip was coded under the
+ assumption that a SIP dialog with an owner channel will always be
+ destroyed after the owner channel has been hung up. However,
+ there are situations where the SIP dialog can time out and auto
+ destruct before the corresponding channel has hung up. A typical
+ example of this would be if the 'h' extension in the dialplan
+ takes a long time to complete. In such cases,
+ __sip_autodestruct() would complain about the dialog being auto
+ destroyed with an owner channel still in place. The problem is
+ that even once the owner channel was hung up, the sip_pvt would
+ still be linked in its ao2_container because nothing would ever
+ unlink it. The fix for this is that if __sip_autodestruct() is
+ called for a sip_pvt that still has an owner channel in place,
+ the destruction is rescheduled for 10 seconds in the future. This
+ will continue until the owner channel is finally hung up. (closes
+ issue ASTERISK-19425) reported by David Cunningham Patches:
+ ASTERISK-19425.patch uploaded by Mark Michelson (License #5049)
+ (closes issue ASTERISK-19455) reported by Dean Vesvuio Tested by
+ Dean Vesvuio
+
+2012-05-08 20:14 +0000 [r365631-365692] Richard Mudgett <rmudgett@digium.com>
+
+ * apps/app_followme.c: * Fix FollowMe memory leak on error paths in
+ app_exec(). * Fix FollowMe leaving recorded caller name file on
+ error paths in app_exec(). * Use correct buffer dimension define
+ in struct call_followme.moh[] and struct fm_args.namerecloc[].
+ This fixes unexpected namerecloc filename length restriction.
+
+ * apps/app_followme.c: * Fix accept/decline DTMF buffer overwrite
+ in FollowMe. * Made use MAX_YN_STRING define to make all
+ accept/decline DTMF buffers the same size. Just using 20 isn't
+ good enough when someone didn't get the memo. * Fix stupid use of
+ a global variable in FollowMe. (ynlongest) * Fix bit field
+ declarations in FollowMe. * Fix FollowMe n option documentation.
+
+2012-05-08 15:48 +0000 [r365574] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Send more accurate identification
+ information in dialog-info SIP NOTIFYs. This uses the calling
+ channel's caller ID and connected line information to populate
+ the remote and local identities in the dialog-info NOTIFY when an
+ extension is ringing. There is a bit of an oddity here, and that
+ is that we seed the remote target with the To header of the
+ outbound call rather than the from header. This is because it was
+ reported that seeding with the from header caused hints to be
+ broken with certain SNOM devices. A comment has been added to the
+ code to explain this. (closes issue ASTERISK-16735) reported by
+ Maciej Krajewski patches: local_remote_hint2.diff uploaded by
+ Mark Michelson (license #5049) 16735_tweak1.diff uploaded by Mark
+ Michelson (license #5049) Tested by Niccolo Belli
+
+2012-05-07 18:40 +0000 [r365476] Richard Mudgett <rmudgett@digium.com>
+
+ * tests/test_config.c: Fix type punned compiler warning in
+ test_config.c
+
+2012-05-07 18:36 +0000 [r365474] Matthew Jordan <mjordan@digium.com>
+
+ * apps/app_voicemail.c, main/pbx.c: Support VoiceMail d() option
+ when extension does not exist in channel's context The VoiceMail
+ d([c]) option is documented to accept digits for a new extension
+ in context <c>, if played during the greeting. This option works
+ fine if the extension being redirected to has an extension with
+ the same initial digit in the channel's current context. If that
+ digit did not happen to exist in some extension, a dialplan match
+ would fail and the user would not be redirected. This patch fixes
+ it such that if the <c> option is used, the extensions are
+ matched in that context as opposed to the caller's original
+ context. (closes issue ASTERISK-18243) Reported by: mjordan
+ Tested by: mjordan Review:
+ https://reviewboard.asterisk.org/r/1892
+
+2012-05-07 16:01 +0000 [r365460] Mark Michelson <mmichelson@digium.com>
+
+ * main/audiohook.c, res/res_speech.c, channels/sig_analog.c,
+ main/abstract_jb.c, res/res_agi.c: Fix findings 0-3, 5, and 8 for
+ Coverity MISSING_BREAK errors. (Issue ASTERISK-19662)
+
+2012-05-04 22:12 +0000 [r365398] Kinsey Moore <kmoore@digium.com>
+
+ * apps/app_followme.c, channels/chan_iax2.c,
+ channels/sip/config_parser.c, pbx/pbx_config.c,
+ apps/app_chanspy.c, apps/app_stack.c, main/config.c,
+ apps/app_voicemail.c, channels/chan_sip.c, funcs/func_aes.c,
+ main/features.c: Fix many issues from the NULL_RETURNS Coverity
+ report Most of the changes here are trivial NULL checks. There
+ are a couple optimizations to remove the need to check for NULL
+ and outboundproxy parsing in chan_sip.c was rewritten to avoid
+ use of strtok. Additionally, a bug was found and fixed with the
+ parsing of outboundproxy when "outboundproxy=," was set. (Closes
+ issue ASTERISK-19654)
+
+2012-05-04 16:24 +0000 [r365313] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_local.c: Fix local channel chains optimizing
+ themselves out of a call. * Made chan_local.c:check_bridge()
+ check the return value of ast_channel_masquerade(). In long
+ chains of local channels, the masquerade occasionally fails to
+ get setup because there is another masquerade already setup on an
+ adjacent local channel in the chain. * Made the outgoing local
+ channel (the ;2 channel) flush one voice or video frame per
+ optimization attempt. * Made sure that the outgoing local channel
+ also does not have any frames in its queue before the masquerade.
+ * Made do the masquerade immediately to minimize the chance that
+ the outgoing channel queue does not get any new frames added and
+ thus unconditionally flushed. * Made block indication -1 (Stop
+ tones) event when the local channel is going to optimize itself
+ out. When the call is answered, a chain of local channels pass
+ down a -1 indication for each bridge. This blizzard of -1 events
+ really slows down the optimization process. (closes issue
+ ASTERISK-16711) Reported by: Alec Davis Tested by: rmudgett, Alec
+ Davis Review: https://reviewboard.asterisk.org/r/1894/
+
+2012-05-04 15:48 +0000 [r365298] Mark Michelson <mmichelson@digium.com>
+
+ * res/res_rtp_asterisk.c: Fix core FINDING 2, FINDING 3, and
+ FINDING 4 from Coverity's CONSTANT_EXPRESSION_RESULT report.
+ These three all are in RTP code that attempts to print the number
+ of sequence number cycles in an RTCP RR report. The code was
+ masking out the upper 16 bits and then shifting the number right
+ by 16 bits. This led to an all zero result in all cases. The fix
+ is to do the shift without the bit masking. (issue
+ ASTERISK-19649)
+
+2012-05-03 14:54 +0000 [r365143-365159] Alexandr Anikin <may@telecom-service.ru>
+
+ * addons/ooh323c/src/h323/H323-MESSAGES.h,
+ addons/ooh323c/src/h323/H323-MESSAGESEnc.c,
+ addons/ooh323c/src/ooh323.c: Fix warning of Coverity Static
+ analysis, change H225ProtocolIdentifier from value to pointer per
+ functions that use this. (close issue ASTERISK-19670) Reported
+ by: Matt Jordan Patches: ASTERISK-19670.patch (License #5415)
+
+ * addons/ooh323c/src/ooq931.c: Fix coverity static analysis
+ warning, allocate full ie structure instead of without data
+ buffer (close issue ASTERISK-19674) Reported by: Matt Jordan
+ Patches: ASTERISK-19674.patch (License #5415)
+
2012-06-04 Asterisk Development Team <asteriskteam@digium.com>
* Asterisk 1.8.13.0 Released.
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/UPGRADE.txt
^
|
@@ -29,6 +29,12 @@
From 1.8.10 to 1.8.11:
+* The BLINDTRANSFER channel variable is deleted from a channel when it is
+ bridged to prevent subtle bugs in the parking feature. The channel
+ variable is used by Asterisk internally for the Park application to work
+ properly. If you were using it for your own purposes, copy it to your
+ own channel variable before the channel is bridged.
+
* If no transport is specified in sip.conf, transport will default to UDP.
Also, if multiple transport= lines are used, only the last will be used.
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/addons/format_mp3.c
^
|
@@ -9,7 +9,7 @@
* Thanks to mpglib from http://www.mpg123.org/
* and Chris Stenton [jacs@gnome.co.uk]
* for coding the ability to play stereo and non-8khz files
-
+
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
@@ -34,7 +34,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366296 $")
#include "mp3/mpg123.h"
#include "mp3/mpglib.h"
@@ -48,20 +48,20 @@
#define MP3_DCACHE 8192
struct mp3_private {
- char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
- char empty; /* Empty character */
- int lasttimeout;
- int maxlen;
- struct timeval last;
+ /*! state for the mp3 decoder */
struct mpstr mp;
+ /*! buffer to hold mp3 data after read from disk */
char sbuf[MP3_SCACHE];
+ /*! buffer for slinear audio after being decoded out of sbuf */
char dbuf[MP3_DCACHE];
+ /*! how much data has been written to the output buffer in the ast_filestream */
int buflen;
+ /*! how much data has been written to sbuf */
int sbuflen;
+ /*! how much data is left to be read out of dbuf, starting at dbufoffset */
int dbuflen;
+ /*! current offset for reading data out of dbuf */
int dbufoffset;
- int sbufoffset;
- int lastseek;
int offset;
long seek;
};
@@ -107,17 +107,17 @@
static void mp3_close(struct ast_filestream *s)
{
struct mp3_private *p = s->_private;
-
+
ExitMP3(&p->mp);
return;
}
-static int mp3_squeue(struct ast_filestream *s)
+static int mp3_squeue(struct ast_filestream *s)
{
struct mp3_private *p = s->_private;
int res=0;
-
- p->lastseek = ftell(s->f);
+
+ res = ftell(s->f);
p->sbuflen = fread(p->sbuf, 1, MP3_SCACHE, s->f);
if(p->sbuflen < 0) {
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", p->sbuflen, strerror(errno));
@@ -131,11 +131,11 @@
return 0;
}
-static int mp3_dqueue(struct ast_filestream *s)
+static int mp3_dqueue(struct ast_filestream *s)
{
struct mp3_private *p = s->_private;
int res=0;
-
+
if((res = decodeMP3(&p->mp,NULL,0,p->dbuf,MP3_DCACHE,&p->dbuflen)) == MP3_OK) {
p->sbuflen -= p->dbuflen;
p->dbufoffset = 0;
@@ -147,7 +147,7 @@
{
struct mp3_private *p = s->_private;
int res = 0, bytes = 0;
-
+
if(p->seek) {
ExitMP3(&p->mp);
InitMP3(&p->mp, OUTSCALE);
@@ -167,7 +167,7 @@
if(res == MP3_ERR)
return -1;
}
-
+
p->seek = 0;
return 0;
}
@@ -181,7 +181,7 @@
if(mp3_squeue(s))
return -1;
}
-
+
}
return 0;
@@ -194,36 +194,41 @@
int delay =0;
int save=0;
- /* Send a frame from the file to the appropriate channel */
-
- if(mp3_queue(s))
+ /* Pre-populate the buffer that holds audio to be returned (dbuf) */
+ if (mp3_queue(s)) {
return NULL;
+ }
- if(p->dbuflen) {
- for(p->buflen=0; p->buflen < MP3_BUFLEN && p->buflen < p->dbuflen; p->buflen++) {
- s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[p->buflen+p->dbufoffset];
- p->sbufoffset++;
+ if (p->dbuflen) {
+ /* Read out what's waiting in dbuf */
+ for (p->buflen = 0; p->buflen < MP3_BUFLEN && p->buflen < p->dbuflen; p->buflen++) {
+ s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[p->buflen + p->dbufoffset];
}
p->dbufoffset += p->buflen;
p->dbuflen -= p->buflen;
+ }
- if(p->buflen < MP3_BUFLEN) {
- if(mp3_queue(s))
- return NULL;
-
- for(save = p->buflen; p->buflen < MP3_BUFLEN; p->buflen++) {
- s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[(p->buflen-save)+p->dbufoffset];
- p->sbufoffset++;
+ if (p->buflen < MP3_BUFLEN) {
+ /* dbuf didn't have enough, so reset dbuf, fill it back up and continue */
+ p->dbuflen = p->dbufoffset = 0;
+
+ if (mp3_queue(s)) {
+ return NULL;
+ }
+
+ /* Make sure dbuf has enough to complete this read attempt */
+ if (p->dbuflen >= (MP3_BUFLEN - p->buflen)) {
+ for (save = p->buflen; p->buflen < MP3_BUFLEN; p->buflen++) {
+ s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[(p->buflen - save) + p->dbufoffset];
}
p->dbufoffset += (MP3_BUFLEN - save);
p->dbuflen -= (MP3_BUFLEN - save);
-
- }
+ }
}
-
+
p->offset += p->buflen;
- delay = p->buflen/2;
+ delay = p->buflen / 2;
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass.codec = AST_FORMAT_SLINEAR;
AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, p->buflen);
@@ -266,16 +271,16 @@
p->seek = offset;
return fseek(s->f, offset, SEEK_SET);
-
+
}
-static int mp3_rewrite(struct ast_filestream *s, const char *comment)
+static int mp3_rewrite(struct ast_filestream *s, const char *comment)
{
ast_log(LOG_ERROR,"I Can't write MP3 only read them.\n");
return -1;
}
-static int mp3_trunc(struct ast_filestream *s)
+static int mp3_trunc(struct ast_filestream *s)
{
ast_log(LOG_ERROR,"I Can't write MP3 only read them.\n");
@@ -285,7 +290,7 @@
static off_t mp3_tell(struct ast_filestream *s)
{
struct mp3_private *p = s->_private;
-
+
return p->offset/2;
}
@@ -321,6 +326,6 @@
static int unload_module(void)
{
return ast_format_unregister(name);
-}
+}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MP3 format [Any rate but 8000hz mono is optimal]");
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/addons/ooh323c/src/h323/H323-MESSAGES.h
^
|
@@ -169,7 +169,7 @@
typedef ASN1OBJID H225ProtocolIdentifier;
-EXTERN int asn1PE_H225ProtocolIdentifier (OOCTXT* pctxt, H225ProtocolIdentifier value);
+EXTERN int asn1PE_H225ProtocolIdentifier (OOCTXT* pctxt, H225ProtocolIdentifier* value);
EXTERN int asn1PD_H225ProtocolIdentifier (OOCTXT* pctxt, H225ProtocolIdentifier* pvalue);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/addons/ooh323c/src/h323/H323-MESSAGESEnc.c
^
|
@@ -223,11 +223,11 @@
/* */
/**************************************************************/
-EXTERN int asn1PE_H225ProtocolIdentifier (OOCTXT* pctxt, H225ProtocolIdentifier value)
+EXTERN int asn1PE_H225ProtocolIdentifier (OOCTXT* pctxt, H225ProtocolIdentifier* value)
{
int stat = ASN_OK;
- stat = encodeObjectIdentifier (pctxt, &value);
+ stat = encodeObjectIdentifier (pctxt, value);
if (stat != ASN_OK) return stat;
return (stat);
@@ -6371,7 +6371,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode h245Address */
@@ -7112,7 +7112,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode destinationInfo */
@@ -7414,7 +7414,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode h245Address */
@@ -7811,7 +7811,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode destinationInfo */
@@ -8173,7 +8173,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
if (extbit) {
@@ -8672,7 +8672,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode reason */
@@ -9157,7 +9157,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode alternativeAddress */
@@ -9580,7 +9580,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode destinationInfo */
@@ -9726,7 +9726,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode callIdentifier */
@@ -9774,7 +9774,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode callIdentifier */
@@ -9822,7 +9822,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode callIdentifier */
@@ -9870,7 +9870,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode callIdentifier */
@@ -12236,7 +12236,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -12530,7 +12530,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -12892,7 +12892,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -13168,7 +13168,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -13913,7 +13913,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -14551,7 +14551,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -21566,7 +21566,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
@@ -21702,7 +21702,7 @@
/* encode protocolIdentifier */
- stat = asn1PE_H225ProtocolIdentifier (pctxt, pvalue->protocolIdentifier);
+ stat = asn1PE_H225ProtocolIdentifier (pctxt, &pvalue->protocolIdentifier);
if (stat != ASN_OK) return stat;
/* encode nonStandardData */
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/addons/ooh323c/src/ooh323.c
^
|
@@ -40,7 +40,7 @@
int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg);
int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg);
int ooHandleDisplayIE(OOH323CallData *call, Q931Message *q931Msg);
-int ooHandleH2250ID (OOH323CallData *call, H225ProtocolIdentifier protocolIdentifier);
+int ooHandleH2250ID (OOH323CallData *call, H225ProtocolIdentifier* protocolIdentifier);
int ooHandleDisplayIE(OOH323CallData *call, Q931Message *q931Msg) {
Q931InformationElement* pDisplayIE;
@@ -58,10 +58,10 @@
return OO_OK;
}
-int ooHandleH2250ID (OOH323CallData *call, H225ProtocolIdentifier protocolIdentifier) {
- if (!call->h225version && (protocolIdentifier.numids >= 6) &&
- (protocolIdentifier.subid[3] == 2250)) {
- call->h225version = protocolIdentifier.subid[5];
+int ooHandleH2250ID (OOH323CallData *call, H225ProtocolIdentifier* protocolIdentifier) {
+ if (!call->h225version && (protocolIdentifier->numids >= 6) &&
+ (protocolIdentifier->subid[3] == 2250)) {
+ call->h225version = protocolIdentifier->subid[5];
OOTRACEDBGC4("Extract H.225 remote version, it's %d, (%s, %s)\n", call->h225version,
call->callType, call->callToken);
@@ -386,7 +386,7 @@
"%s\n", call->callType, call->callToken);
return OO_FAILED;
}
- ooHandleH2250ID(call, setup->protocolIdentifier);
+ ooHandleH2250ID(call, &setup->protocolIdentifier);
memcpy(call->callIdentifier.guid.data, setup->callIdentifier.guid.data,
setup->callIdentifier.guid.numocts);
call->callIdentifier.guid.numocts = setup->callIdentifier.guid.numocts;
@@ -633,7 +633,7 @@
return OO_FAILED;
}
- ooHandleH2250ID(call, callProceeding->protocolIdentifier);
+ ooHandleH2250ID(call, &callProceeding->protocolIdentifier);
/* Handle fast-start */
if(OO_TESTFLAG (call->flags, OO_M_FASTSTART))
{
@@ -862,7 +862,7 @@
}
return OO_FAILED;
}
- ooHandleH2250ID(call, alerting->protocolIdentifier);
+ ooHandleH2250ID(call, &alerting->protocolIdentifier);
/*Handle fast-start */
if(OO_TESTFLAG (call->flags, OO_M_FASTSTART) &&
!OO_TESTFLAG(call->flags, OO_M_FASTSTARTANSWERED))
@@ -1099,7 +1099,7 @@
}
return OO_FAILED;
}
- ooHandleH2250ID(call, progress->protocolIdentifier);
+ ooHandleH2250ID(call, &progress->protocolIdentifier);
/*Handle fast-start */
if(OO_TESTFLAG (call->flags, OO_M_FASTSTART) &&
!OO_TESTFLAG(call->flags, OO_M_FASTSTARTANSWERED))
@@ -1343,7 +1343,7 @@
}
return OO_FAILED;
}
- ooHandleH2250ID(call, connect->protocolIdentifier);
+ ooHandleH2250ID(call, &connect->protocolIdentifier);
/*Handle fast-start */
if(OO_TESTFLAG (call->flags, OO_M_FASTSTART) &&
!OO_TESTFLAG (call->flags, OO_M_FASTSTARTANSWERED))
@@ -1841,7 +1841,7 @@
facility = pH323UUPdu->h323_message_body.u.facility;
if(facility)
{
- ooHandleH2250ID(call, facility->protocolIdentifier);
+ ooHandleH2250ID(call, &facility->protocolIdentifier);
/* Depending on the reason of facility message handle the message */
if(facility->reason.t == T_H225FacilityReason_transportedInformation)
{
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/addons/ooh323c/src/ooq931.c
^
|
@@ -140,7 +140,7 @@
}
else {
ie = (Q931InformationElement*) memAlloc (pctxt,
- sizeof(*ie) - sizeof(ie->data));
+ sizeof(*ie));
if(!ie)
{
OOTRACEERR3("Error:Memory - ooQ931Decode - ie(%s, %s)\n",
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_chanspy.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366048 $")
#include <ctype.h>
#include <errno.h>
@@ -765,13 +765,10 @@
const char *context, const char *mailbox, const char *name_context)
{
char nameprefix[AST_NAME_STRLEN];
- char peer_name[AST_NAME_STRLEN + 5];
char exitcontext[AST_MAX_CONTEXT] = "";
signed char zero_volume = 0;
int waitms;
int res;
- char *ptr;
- int num;
int num_spyed_upon = 1;
struct ast_channel_iterator *iter = NULL;
@@ -861,7 +858,6 @@
next_channel(iter, autochan, chan), next_autochan = NULL) {
int igrp = !mygroup;
int ienf = !myenforced;
- char *s;
if (autochan->chan == prev) {
ast_autochan_destroy(autochan);
@@ -946,22 +942,34 @@
continue;
}
- strcpy(peer_name, "spy-");
- strncat(peer_name, autochan->chan->name, AST_NAME_STRLEN - 4 - 1);
- ptr = strchr(peer_name, '/');
- *ptr++ = '\0';
- ptr = strsep(&ptr, "-");
-
- for (s = peer_name; s < ptr; s++)
- *s = tolower(*s);
if (!ast_test_flag(flags, OPTION_QUIET)) {
+ char peer_name[AST_NAME_STRLEN + 5];
+ char *ptr, *s;
+
+ strcpy(peer_name, "spy-");
+ strncat(peer_name, autochan->chan->name, AST_NAME_STRLEN - 4 - 1);
+ if ((ptr = strchr(peer_name, '/'))) {
+ *ptr++ = '\0';
+ for (s = peer_name; s < ptr; s++) {
+ *s = tolower(*s);
+ }
+ if ((s = strchr(ptr, '-'))) {
+ *s = '\0';
+ }
+ }
+
if (ast_test_flag(flags, OPTION_NAME)) {
const char *local_context = S_OR(name_context, "default");
const char *local_mailbox = S_OR(mailbox, ptr);
- res = ast_app_sayname(chan, local_mailbox, local_context);
+ if (local_mailbox) {
+ res = ast_app_sayname(chan, local_mailbox, local_context);
+ } else {
+ res = -1;
+ }
}
if (!ast_test_flag(flags, OPTION_NAME) || res < 0) {
+ int num;
if (!ast_test_flag(flags, OPTION_NOTECH)) {
if (ast_fileexists(peer_name, NULL, NULL) > 0) {
res = ast_streamfile(chan, peer_name, chan->language);
@@ -976,8 +984,9 @@
res = ast_say_character_str(chan, peer_name, "", chan->language);
}
}
- if ((num = atoi(ptr)))
- ast_say_digits(chan, atoi(ptr), "", chan->language);
+ if (ptr && (num = atoi(ptr))) {
+ ast_say_digits(chan, num, "", chan->language);
+ }
}
}
@@ -1241,6 +1250,7 @@
}
} else {
+ /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
ast_clear_flag(&flags, AST_FLAGS_ALL);
}
@@ -1285,6 +1295,7 @@
int res;
char *mygroup = NULL;
+ /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
ast_clear_flag(&flags, AST_FLAGS_ALL);
if (!ast_strlen_zero(data)) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_dial.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362997 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367678 $")
#include <sys/time.h>
#include <sys/signal.h>
@@ -823,7 +823,8 @@
* \param o Outgoing call channel list.
* \param num Incoming call channel cause accumulation
* \param peerflags Dial option flags
- * \param single_caller_bored From wait_for_answer: single && !caller_entertained
+ * \param single TRUE if there is only one outgoing call.
+ * \param caller_entertained TRUE if the caller is being entertained by MOH or ringback.
* \param to Remaining call timeout time.
* \param forced_clid OPT_FORCECLID caller id to send
* \param stored_clid Caller id representing the called party if needed
@@ -833,8 +834,8 @@
*
* \todo eventually this function should be intergrated into and replaced by ast_call_forward()
*/
-static void do_forward(struct chanlist *o,
- struct cause_args *num, struct ast_flags64 *peerflags, int single_caller_bored, int *to,
+static void do_forward(struct chanlist *o, struct cause_args *num,
+ struct ast_flags64 *peerflags, int single, int caller_entertained, int *to,
struct ast_party_id *forced_clid, struct ast_party_id *stored_clid)
{
char tmpchan[256];
@@ -862,6 +863,14 @@
stuff = tmpchan;
tech = "Local";
}
+ if (!strcasecmp(tech, "Local")) {
+ /*
+ * Drop the connected line update block for local channels since
+ * this is going to run dialplan and the user can change his
+ * mind about what connected line information he wants to send.
+ */
+ ast_clear_flag64(o, OPT_IGNORE_CONNECTEDLINE);
+ }
ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
@@ -876,11 +885,14 @@
/* Setup parameters */
c = o->chan = ast_request(tech, in->nativeformats, in, stuff, &cause);
if (c) {
- if (single_caller_bored) {
+ if (single && !caller_entertained) {
ast_channel_make_compatible(o->chan, in);
}
+ ast_channel_lock_both(in, o->chan);
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
+ ast_channel_unlock(in);
+ ast_channel_unlock(o->chan);
/* When a call is forwarded, we don't want to track new interfaces
* dialed for CC purposes. Setting the done flag will ensure that
* any Dial operations that happen later won't record CC interfaces.
@@ -897,17 +909,17 @@
handle_cause(cause, num);
ast_hangup(original);
} else {
- struct ast_party_redirecting redirecting;
+ ast_channel_lock_both(c, original);
+ ast_party_redirecting_copy(&c->redirecting, &original->redirecting);
+ ast_channel_unlock(c);
+ ast_channel_unlock(original);
+
+ ast_channel_lock_both(c, in);
- if (single_caller_bored && CAN_EARLY_BRIDGE(peerflags, c, in)) {
+ if (single && !caller_entertained && CAN_EARLY_BRIDGE(peerflags, c, in)) {
ast_rtp_instance_early_bridge_make_compatible(c, in);
}
- ast_channel_set_redirecting(c, &original->redirecting, NULL);
- ast_channel_lock(c);
- while (ast_channel_trylock(in)) {
- CHANNEL_DEADLOCK_AVOIDANCE(c);
- }
if (!c->redirecting.from.number.valid
|| ast_strlen_zero(c->redirecting.from.number.str)) {
/*
@@ -928,6 +940,7 @@
if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
caller.id = *stored_clid;
ast_channel_set_caller_event(c, &caller, NULL);
+ ast_set_flag64(o, DIAL_CALLERID_ABSENT);
} else if (ast_strlen_zero(S_COR(c->caller.id.number.valid,
c->caller.id.number.str, NULL))) {
/*
@@ -936,6 +949,9 @@
*/
caller.id = *stored_clid;
ast_channel_set_caller_event(c, &caller, NULL);
+ ast_set_flag64(o, DIAL_CALLERID_ABSENT);
+ } else {
+ ast_clear_flag64(o, DIAL_CALLERID_ABSENT);
}
/* Determine CallerID for outgoing channel to send. */
@@ -953,22 +969,32 @@
c->appl = "AppDial";
c->data = "(Outgoing Line)";
- /*
- * We must unlock c before calling ast_channel_redirecting_macro, because
- * we put c into autoservice there. That is pretty much a guaranteed
- * deadlock. This is why the handling of c's lock may seem a bit unusual
- * here.
- */
- ast_party_redirecting_init(&redirecting);
- ast_party_redirecting_copy(&redirecting, &c->redirecting);
- ast_channel_unlock(c);
- if (ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
- ast_channel_update_redirecting(in, &redirecting, NULL);
- }
- ast_party_redirecting_free(&redirecting);
+
ast_channel_unlock(in);
+ if (single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
+ struct ast_party_redirecting redirecting;
+
+ /*
+ * Redirecting updates to the caller make sense only on single
+ * calls.
+ *
+ * We must unlock c before calling
+ * ast_channel_redirecting_macro, because we put c into
+ * autoservice there. That is pretty much a guaranteed
+ * deadlock. This is why the handling of c's lock may seem a
+ * bit unusual here.
+ */
+ ast_party_redirecting_init(&redirecting);
+ ast_party_redirecting_copy(&redirecting, &c->redirecting);
+ ast_channel_unlock(c);
+ if (ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
+ ast_channel_update_redirecting(in, &redirecting, NULL);
+ }
+ ast_party_redirecting_free(&redirecting);
+ } else {
+ ast_channel_unlock(c);
+ }
- ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
if (ast_test_flag64(peerflags, OPT_CANCEL_TIMEOUT)) {
*to = -1;
}
@@ -982,17 +1008,14 @@
c = o->chan = NULL;
num->nochan++;
} else {
- ast_channel_lock(c);
- while (ast_channel_trylock(in)) {
- CHANNEL_DEADLOCK_AVOIDANCE(c);
- }
+ ast_channel_lock_both(c, in);
senddialevent(in, c, stuff);
ast_channel_unlock(in);
ast_channel_unlock(c);
/* Hangup the original channel now, in case we needed it */
ast_hangup(original);
}
- if (single_caller_bored) {
+ if (single && !caller_entertained) {
ast_indicate(in, -1);
}
}
@@ -1052,7 +1075,8 @@
}
}
- if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
+ if (!ast_test_flag64(outgoing, OPT_IGNORE_CONNECTEDLINE)
+ && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
ast_channel_lock(outgoing->chan);
ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
ast_channel_unlock(outgoing->chan);
@@ -1113,7 +1137,7 @@
if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
if (!peer) {
ast_verb(3, "%s answered %s\n", c->name, in->name);
- if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+ if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
@@ -1164,8 +1188,35 @@
}
ast_frfree(f);
}
- do_forward(o, &num, peerflags, single && !caller_entertained, to,
+
+ if (o->pending_connected_update) {
+ /*
+ * Re-seed the chanlist's connected line information with
+ * previously acquired connected line info from the incoming
+ * channel. The previously acquired connected line info could
+ * have been set through the CONNECTED_LINE dialplan function.
+ */
+ o->pending_connected_update = 0;
+ ast_channel_lock(in);
+ ast_party_connected_line_copy(&o->connected, &in->connected);
+ ast_channel_unlock(in);
+ }
+
+ do_forward(o, &num, peerflags, single, caller_entertained, to,
forced_clid, stored_clid);
+
+ if (single && o->chan
+ && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)
+ && !ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
+ ast_channel_lock(o->chan);
+ ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller);
+ ast_channel_unlock(o->chan);
+ connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+ if (ast_channel_connected_line_macro(o->chan, in, &connected_caller, 1, 0)) {
+ ast_channel_update_connected_line(in, &connected_caller, NULL);
+ }
+ ast_party_connected_line_free(&connected_caller);
+ }
continue;
}
f = ast_read(winner);
@@ -1187,7 +1238,7 @@
/* This is our guy if someone answered. */
if (!peer) {
ast_verb(3, "%s answered %s\n", c->name, in->name);
- if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+ if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
@@ -1319,20 +1370,24 @@
ast_indicate(in, f->subclass.integer);
break;
case AST_CONTROL_CONNECTED_LINE:
- if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+ if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
ast_verb(3, "Connected line update to %s prevented.\n", in->name);
- } else if (!single) {
+ break;
+ }
+ if (!single) {
struct ast_party_connected_line connected;
- ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", c->name, in->name);
+
+ ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n",
+ c->name, in->name);
ast_party_connected_line_set_init(&connected, &o->connected);
ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
ast_party_connected_line_set(&o->connected, &connected, NULL);
ast_party_connected_line_free(&connected);
o->pending_connected_update = 1;
- } else {
- if (ast_channel_connected_line_macro(c, in, f, 1, 1)) {
- ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
- }
+ break;
+ }
+ if (ast_channel_connected_line_macro(c, in, f, 1, 1)) {
+ ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
}
break;
case AST_CONTROL_AOC:
@@ -1347,15 +1402,23 @@
}
break;
case AST_CONTROL_REDIRECTING:
- if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+ if (!single) {
+ /*
+ * Redirecting updates to the caller make sense only on single
+ * calls.
+ */
+ break;
+ }
+ if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
ast_verb(3, "Redirecting update to %s prevented.\n", in->name);
- } else if (single) {
- ast_verb(3, "%s redirecting info has changed, passing it to %s\n", c->name, in->name);
- if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
- ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
- }
- pa->sentringing = 0;
+ break;
}
+ ast_verb(3, "%s redirecting info has changed, passing it to %s\n",
+ c->name, in->name);
+ if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
+ ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+ }
+ pa->sentringing = 0;
break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
@@ -2162,9 +2225,12 @@
} else if ((outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP"))) {
outbound_group = ast_strdupa(outbound_group);
}
- ast_channel_unlock(chan);
- ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE |
- OPT_CANCEL_TIMEOUT | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);
+ ast_channel_unlock(chan);
+
+ /* Set per dial instance flags. These flags are also passed back to RetryDial. */
+ ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID
+ | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_CANCEL_TIMEOUT
+ | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);
/* loop through the list of dial destinations */
rest = args.peers;
@@ -2186,6 +2252,7 @@
if (!(tmp = ast_calloc(1, sizeof(*tmp))))
goto out;
if (opts.flags) {
+ /* Set per outgoing call leg options. */
ast_copy_flags64(tmp, &opts,
OPT_CANCEL_ELSEWHERE |
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -2193,7 +2260,7 @@
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
OPT_CALLEE_PARK | OPT_CALLER_PARK |
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
- OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
+ OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID | OPT_IGNORE_CONNECTEDLINE);
ast_set2_flag64(tmp, args.url, DIAL_NOFORWARDHTML);
}
ast_copy_string(numsubst, number, sizeof(numsubst));
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_disa.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366048 $")
#include <math.h>
#include <sys/time.h>
@@ -181,8 +181,13 @@
args.context = "disa";
if (ast_strlen_zero(args.mailbox))
args.mailbox = "";
- if (!ast_strlen_zero(args.options))
+ if (!ast_strlen_zero(args.options)) {
ast_app_parse_options(app_opts, &flags, NULL, args.options);
+ } else {
+ /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
+ ast_clear_flag(&flags, AST_FLAGS_ALL);
+ }
+
ast_debug(1, "Mailbox: %s\n",args.mailbox);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_followme.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 350364 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365692 $")
#include <signal.h>
@@ -80,7 +80,7 @@
</option>
<option name="n">
<para>Playback the unreachable status message if we've run out
- of steps to reach the or the callee has elected not to be reachable.</para>
+ of steps or the callee has elected not to be reachable.</para>
</option>
<option name="s">
<para>Playback the incoming status message prior to starting
@@ -102,6 +102,9 @@
static char *app = "FollowMe";
+/*! Maximum accept/decline DTMF string plus terminator. */
+#define MAX_YN_STRING 20
+
/*! \brief Number structure */
struct number {
char number[512]; /*!< Phone Number(s) and/or Extension(s) */
@@ -114,12 +117,12 @@
struct call_followme {
ast_mutex_t lock;
char name[AST_MAX_EXTENSION]; /*!< Name - FollowMeID */
- char moh[AST_MAX_CONTEXT]; /*!< Music On Hold Class to be used */
+ char moh[MAX_MUSICCLASS]; /*!< Music On Hold Class to be used */
char context[AST_MAX_CONTEXT]; /*!< Context to dial from */
unsigned int active; /*!< Profile is active (1), or disabled (0). */
int realtime; /*!< Cached from realtime */
- char takecall[20]; /*!< Digit mapping to take a call */
- char nextindp[20]; /*!< Digit mapping to decline a call */
+ char takecall[MAX_YN_STRING]; /*!< Digit mapping to take a call */
+ char nextindp[MAX_YN_STRING]; /*!< Digit mapping to decline a call */
char callfromprompt[PATH_MAX]; /*!< Sound prompt name and path */
char norecordingprompt[PATH_MAX]; /*!< Sound prompt name and path */
char optionsprompt[PATH_MAX]; /*!< Sound prompt name and path */
@@ -145,14 +148,14 @@
/*! Accumulated connected line information from outbound call. */
struct ast_party_connected_line connected_out;
/*! TRUE if connected line information from inbound call changed. */
- int pending_in_connected_update:1;
+ unsigned int pending_in_connected_update:1;
/*! TRUE if connected line information from outbound call is available. */
- int pending_out_connected_update:1;
+ unsigned int pending_out_connected_update:1;
int status;
char context[AST_MAX_CONTEXT];
- char namerecloc[AST_MAX_CONTEXT];
- char takecall[20]; /*!< Digit mapping to take a call */
- char nextindp[20]; /*!< Digit mapping to decline a call */
+ char namerecloc[PATH_MAX];
+ char takecall[MAX_YN_STRING]; /*!< Digit mapping to take a call */
+ char nextindp[MAX_YN_STRING]; /*!< Digit mapping to decline a call */
char callfromprompt[PATH_MAX]; /*!< Sound prompt name and path */
char norecordingprompt[PATH_MAX]; /*!< Sound prompt name and path */
char optionsprompt[PATH_MAX]; /*!< Sound prompt name and path */
@@ -170,11 +173,12 @@
int ynidx;
int state;
char dialarg[256];
- char yn[10];
+ /*! Collected digits to accept/decline the call. */
+ char yn[MAX_YN_STRING];
/*! TRUE if call cleared. */
- int cleared:1;
+ unsigned int cleared:1;
/*! TRUE if connected line information is available. */
- int pending_connected_update:1;
+ unsigned int pending_connected_update:1;
AST_LIST_ENTRY(findme_user) entry;
};
@@ -194,13 +198,12 @@
AST_APP_OPTION('s', FOLLOWMEFLAG_STATUSMSG),
});
-static int ynlongest = 0;
-
static const char *featuredigittostr;
static int featuredigittimeout = 5000; /*!< Feature Digit Timeout */
static const char *defaultmoh = "default"; /*!< Default Music-On-Hold Class */
-static char takecall[20] = "1", nextindp[20] = "2";
+static char takecall[MAX_YN_STRING] = "1";
+static char nextindp[MAX_YN_STRING] = "2";
static char callfromprompt[PATH_MAX] = "followme/call-from";
static char norecordingprompt[PATH_MAX] = "followme/no-recording";
static char optionsprompt[PATH_MAX] = "followme/options";
@@ -822,21 +825,19 @@
ast_stopstream(winner);
tmpuser->digts = 0;
ast_debug(1, "DTMF received: %c\n", (char) f->subclass.integer);
- tmpuser->yn[tmpuser->ynidx] = (char) f->subclass.integer;
- tmpuser->ynidx++;
+ if (tmpuser->ynidx < ARRAY_LEN(tmpuser->yn) - 1) {
+ tmpuser->yn[tmpuser->ynidx++] = (char) f->subclass.integer;
+ }
ast_debug(1, "DTMF string: %s\n", tmpuser->yn);
- if (tmpuser->ynidx >= ynlongest) {
- ast_debug(1, "reached longest possible match - doing evals\n");
- if (!strcmp(tmpuser->yn, tpargs->takecall)) {
- ast_debug(1, "Match to take the call!\n");
- ast_frfree(f);
- return tmpuser->ochan;
- }
- if (!strcmp(tmpuser->yn, tpargs->nextindp)) {
- ast_debug(1, "Next in dial plan step requested.\n");
- ast_frfree(f);
- return NULL;
- }
+ if (!strcmp(tmpuser->yn, tpargs->takecall)) {
+ ast_debug(1, "Match to take the call!\n");
+ ast_frfree(f);
+ return tmpuser->ochan;
+ }
+ if (!strcmp(tmpuser->yn, tpargs->nextindp)) {
+ ast_debug(1, "Next in dial plan step requested.\n");
+ ast_frfree(f);
+ return NULL;
}
}
@@ -884,16 +885,11 @@
struct findme_user_listptr *findme_user_list;
findme_user_list = ast_calloc(1, sizeof(*findme_user_list));
- AST_LIST_HEAD_INIT_NOLOCK(findme_user_list);
-
- /* We're going to figure out what the longest possible string of digits to collect is */
- ynlongest = 0;
- if (strlen(tpargs->takecall) > ynlongest) {
- ynlongest = strlen(tpargs->takecall);
- }
- if (strlen(tpargs->nextindp) > ynlongest) {
- ynlongest = strlen(tpargs->nextindp);
+ if (!findme_user_list) {
+ ast_log(LOG_WARNING, "Failed to allocate memory for findme_user_list\n");
+ return;
}
+ AST_LIST_HEAD_INIT_NOLOCK(findme_user_list);
caller = tpargs->chan;
for (idx = 1; !ast_check_hangup(caller); ++idx) {
@@ -1135,8 +1131,6 @@
struct number *nm, *newnm;
int res = 0;
char *argstr;
- char namerecloc[255];
- int duration = 0;
struct ast_channel *caller;
struct ast_channel *outbound;
AST_DECLARE_APP_ARGS(args,
@@ -1211,15 +1205,22 @@
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_STATUSMSG))
ast_stream_and_wait(chan, targs.statusprompt, "");
- snprintf(namerecloc,sizeof(namerecloc),"%s/followme.%s",ast_config_AST_SPOOL_DIR,chan->uniqueid);
- duration = 5;
+ if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_RECORDNAME)) {
+ int duration = 5;
+
+ snprintf(targs.namerecloc, sizeof(targs.namerecloc), "%s/followme.%s",
+ ast_config_AST_SPOOL_DIR, chan->uniqueid);
- if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_RECORDNAME))
- if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, NULL, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL) < 0)
+ if (ast_play_and_record(chan, "vm-rec-name", targs.namerecloc, 5, "sln", &duration,
+ NULL, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL) < 0) {
goto outrun;
+ }
+
+ if (!ast_fileexists(targs.namerecloc, NULL, chan->language)) {
+ targs.namerecloc[0] = '\0';
+ }
+ }
- if (!ast_fileexists(namerecloc, NULL, chan->language))
- ast_copy_string(namerecloc, "", sizeof(namerecloc));
if (!ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_DISABLEHOLDPROMPT)) {
if (ast_streamfile(chan, targs.plsholdprompt, chan->language))
goto outrun;
@@ -1230,19 +1231,11 @@
targs.status = 0;
targs.chan = chan;
- ast_copy_string(targs.namerecloc, namerecloc, sizeof(targs.namerecloc));
ast_channel_lock(chan);
ast_connected_line_copy_from_caller(&targs.connected_in, &chan->caller);
ast_channel_unlock(chan);
findmeexec(&targs);
-
- while ((nm = AST_LIST_REMOVE_HEAD(&targs.cnumbers, entry)))
- ast_free(nm);
-
- if (!ast_strlen_zero(namerecloc))
- unlink(namerecloc);
-
if (targs.status != 100) {
ast_moh_stop(chan);
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_UNREACHABLEMSG))
@@ -1291,8 +1284,15 @@
}
outrun:
+ while ((nm = AST_LIST_REMOVE_HEAD(&targs.cnumbers, entry))) {
+ ast_free(nm);
+ }
+ if (!ast_strlen_zero(targs.namerecloc)) {
+ unlink(targs.namerecloc);
+ }
ast_party_connected_line_free(&targs.connected_in);
ast_party_connected_line_free(&targs.connected_out);
+
if (f->realtime) {
/* Not in list */
free_numbers(f);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_meetme.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362079 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367906 $")
#include <dahdi/user.h>
@@ -2135,12 +2135,12 @@
static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
{
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalking",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %d\r\n"
- "Status: %s\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "Status: %s\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
}
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
@@ -3050,12 +3050,12 @@
}
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %i\r\n"
- "Status: on\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "Status: on\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
}
/* If I should be un-muted but am not talker, un-mute me */
@@ -3068,12 +3068,12 @@
}
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %i\r\n"
- "Status: off\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "Status: off\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
}
if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
@@ -3081,12 +3081,12 @@
talkreq_manager = 1;
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %i\r\n"
- "Status: on\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "Status: on\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
}
@@ -3094,12 +3094,12 @@
!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
talkreq_manager = 0;
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %i\r\n"
- "Status: off\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "Status: off\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
}
/* If I have been kicked, exit the conference */
@@ -4463,9 +4463,8 @@
{
struct ast_conf_user *user = NULL;
int cid;
-
- sscanf(callerident, "%30i", &cid);
- if (conf && callerident) {
+
+ if (conf && callerident && sscanf(callerident, "%30d", &cid) == 1) {
user = ao2_find(conf->usercontainer, &cid, 0);
/* reference decremented later in admin_exec */
return user;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_minivm.c
^
|
@@ -147,7 +147,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 337973 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368533 $")
#include <ctype.h>
#include <sys/time.h>
@@ -1255,6 +1255,8 @@
if (ast_strlen_zero(email)) {
ast_log(LOG_WARNING, "No address to send message to.\n");
+ ast_free(str1);
+ ast_free(str2);
return -1;
}
@@ -1309,11 +1311,15 @@
}
if (!p) {
ast_log(LOG_WARNING, "Unable to open temporary file '%s'\n", tmp);
+ ast_free(str1);
+ ast_free(str2);
return -1;
}
/* Allocate channel used for chanvar substitution */
ast = ast_dummy_channel_alloc();
if (!ast) {
+ ast_free(str1);
+ ast_free(str2);
return -1;
}
@@ -2085,7 +2091,7 @@
char *domain;
char *tmpptr;
struct minivm_account *vmu;
- char *username = argv[0];
+ char *username;
const char *template = "";
const char *filename;
const char *format;
@@ -2459,7 +2465,7 @@
char *domain;
char *tmpptr = NULL;
struct minivm_account *vmu;
- char *username = argv[0];
+ char *username;
struct ast_flags flags = { 0 };
char *opts[OPT_ARG_ARRAY_SIZE];
int error = FALSE;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_page.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 360363 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
@@ -177,6 +177,11 @@
if (!ast_strlen_zero(args.options)) {
ast_app_parse_options(page_opts, &flags, opts, args.options);
+ } else {
+ /* opts must be initialized if there wasn't an options string. */
+ for (i = 0; i < OPT_ARG_ARRAY_SIZE; i++) {
+ opts[i] = NULL;
+ }
}
if (!ast_strlen_zero(args.timeout)) {
@@ -243,6 +248,7 @@
/* Append technology and resource */
if (ast_dial_append(dial, tech, resource) == -1) {
ast_log(LOG_ERROR, "Failed to add %s to outbound dial\n", tech);
+ ast_dial_destroy(dial);
continue;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_queue.c
^
|
@@ -63,7 +63,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 359609 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <sys/time.h>
#include <sys/signal.h>
@@ -983,7 +983,6 @@
struct callattempt *call_next;
struct ast_channel *chan;
char interface[256];
- int stillgoing;
int metric;
time_t lastcall;
struct call_queue *lastqueue;
@@ -992,8 +991,12 @@
struct ast_party_connected_line connected;
/*! TRUE if an AST_CONTROL_CONNECTED_LINE update was saved to the connected element. */
unsigned int pending_connected_update:1;
+ /*! TRUE if the connected line update is blocked. */
+ unsigned int block_connected_update:1;
/*! TRUE if caller id is not available for connected line */
unsigned int dial_callerid_absent:1;
+ /*! TRUE if the call is still active */
+ unsigned int stillgoing:1;
struct ast_aoc_decoded *aoc_s_rate_list;
};
@@ -1825,9 +1828,17 @@
if (!inserted) {
AST_LIST_INSERT_TAIL(&rl_iter->rules, rule, list);
+ inserted = 1;
}
+
+ break;
}
+ if (!inserted) {
+ ast_log(LOG_WARNING, "Unknown rule list name %s; ignoring.\n", list_name);
+ ast_free(rule);
+ return -1;
+ }
return 0;
}
@@ -2481,11 +2492,11 @@
*/
if (!inserted && (qe->prio >= cur->prio) && position && (position <= pos + 1)) {
insert_entry(q, prev, qe, &pos);
+ inserted = 1;
/*pos is incremented inside insert_entry, so don't need to add 1 here*/
if (position < pos) {
ast_log(LOG_NOTICE, "Asked to be inserted at position %d but forced into position %d due to higher priority callers\n", position, pos);
}
- inserted = 1;
}
cur->pos = ++pos;
prev = cur;
@@ -3417,15 +3428,13 @@
* \param[in] prebusies number of busy members calculated prior to calling wait_for_answer
* \param[in] caller_disconnect if the 'H' option is used when calling Queue(), this is used to detect if the caller pressed * to disconnect the call
* \param[in] forwardsallowed used to detect if we should allow call forwarding, based on the 'i' option to Queue()
- * \param[in] update_connectedline Allow connected line and redirecting updates to pass through.
*
* \todo eventually all call forward logic should be intergerated into and replaced by ast_call_forward()
*/
-static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed, int update_connectedline)
+static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed)
{
const char *queue = qe->parent->name;
struct callattempt *o, *start = NULL, *prev = NULL;
- int res;
int status;
int numbusies = prebusies;
int numnochan = 0;
@@ -3506,10 +3515,11 @@
/* Service all of the outgoing channels */
for (o = start; o; o = o->call_next) {
- /* We go with a static buffer here instead of using ast_strdupa. Using
+ /* We go with a fixed buffer here instead of using ast_strdupa. Using
* ast_strdupa in a loop like this one can cause a stack overflow
*/
char ochan_name[AST_CHANNEL_NAME];
+
if (o->chan) {
ast_channel_lock(o->chan);
ast_copy_string(ochan_name, o->chan->name, sizeof(ochan_name));
@@ -3518,7 +3528,7 @@
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
if (!peer) {
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
- if (update_connectedline) {
+ if (!o->block_connected_update) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
@@ -3549,6 +3559,7 @@
ast_copy_string(on, o->member->interface, sizeof(on));
ast_copy_string(membername, o->member->membername, sizeof(membername));
+ /* Before processing channel, go ahead and check for forwarding */
if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
ast_verb(3, "Forwarding %s to '%s' prevented.\n", inchan_name, o->chan->call_forward);
numnochan++;
@@ -3570,10 +3581,17 @@
stuff = tmpchan;
tech = "Local";
}
+ if (!strcasecmp(tech, "Local")) {
+ /*
+ * Drop the connected line update block for local channels since
+ * this is going to run dialplan and the user can change his
+ * mind about what connected line information he wants to send.
+ */
+ o->block_connected_update = 0;
+ }
ast_cel_report_event(in, AST_CEL_FORWARD, NULL, o->chan->call_forward, NULL);
- /* Before processing channel, go ahead and check for forwarding */
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
/* Setup parameters */
o->chan = ast_request(tech, in->nativeformats, in, stuff, &status);
@@ -3584,15 +3602,28 @@
o->stillgoing = 0;
numnochan++;
} else {
- struct ast_party_redirecting redirecting;
+ ast_channel_lock_both(o->chan, original);
+ ast_party_redirecting_copy(&o->chan->redirecting, &original->redirecting);
+ ast_channel_unlock(o->chan);
+ ast_channel_unlock(original);
ast_channel_lock_both(o->chan, in);
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
+ if (o->pending_connected_update) {
+ /*
+ * Re-seed the callattempt's connected line information with
+ * previously acquired connected line info from the queued
+ * channel. The previously acquired connected line info could
+ * have been set through the CONNECTED_LINE dialplan function.
+ */
+ o->pending_connected_update = 0;
+ ast_party_connected_line_copy(&o->connected, &in->connected);
+ }
+
ast_string_field_set(o->chan, accountcode, in->accountcode);
- ast_channel_set_redirecting(o->chan, &original->redirecting, NULL);
if (!o->chan->redirecting.from.number.valid
|| ast_strlen_zero(o->chan->redirecting.from.number.str)) {
/*
@@ -3608,27 +3639,35 @@
o->chan->dialed.transit_network_select = in->dialed.transit_network_select;
- ast_party_caller_copy(&o->chan->caller, &in->caller);
- ast_party_connected_line_copy(&o->chan->connected, &original->connected);
+ o->dial_callerid_absent = !o->chan->caller.id.number.valid
+ || ast_strlen_zero(o->chan->caller.id.number.str);
+ ast_connected_line_copy_from_caller(&o->chan->connected, &in->caller);
- /*
- * We must unlock o->chan before calling
- * ast_channel_redirecting_macro, because we put o->chan into
- * autoservice there. That is pretty much a guaranteed
- * deadlock. This is why the handling of o->chan's lock may
- * seem a bit unusual here.
- */
- ast_party_redirecting_init(&redirecting);
- ast_party_redirecting_copy(&redirecting, &o->chan->redirecting);
- ast_channel_unlock(o->chan);
- res = ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0);
- if (res) {
- ast_channel_update_redirecting(in, &redirecting, NULL);
- }
- ast_party_redirecting_free(&redirecting);
ast_channel_unlock(in);
+ if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL
+ && !o->block_connected_update) {
+ struct ast_party_redirecting redirecting;
- update_connectedline = 1;
+ /*
+ * Redirecting updates to the caller make sense only on single
+ * call at a time strategies.
+ *
+ * We must unlock o->chan before calling
+ * ast_channel_redirecting_macro, because we put o->chan into
+ * autoservice there. That is pretty much a guaranteed
+ * deadlock. This is why the handling of o->chan's lock may
+ * seem a bit unusual here.
+ */
+ ast_party_redirecting_init(&redirecting);
+ ast_party_redirecting_copy(&redirecting, &o->chan->redirecting);
+ ast_channel_unlock(o->chan);
+ if (ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0)) {
+ ast_channel_update_redirecting(in, &redirecting, NULL);
+ }
+ ast_party_redirecting_free(&redirecting);
+ } else {
+ ast_channel_unlock(o->chan);
+ }
if (ast_call(o->chan, stuff, 0)) {
ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n",
@@ -3649,7 +3688,7 @@
/* This is our guy if someone answered. */
if (!peer) {
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
- if (update_connectedline) {
+ if (!o->block_connected_update) {
if (o->pending_connected_update) {
if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
@@ -3726,20 +3765,30 @@
/* Ignore going off hook */
break;
case AST_CONTROL_CONNECTED_LINE:
- if (!update_connectedline) {
+ if (o->block_connected_update) {
ast_verb(3, "Connected line update to %s prevented.\n", inchan_name);
- } else if (qe->parent->strategy == QUEUE_STRATEGY_RINGALL) {
+ break;
+ }
+ if (qe->parent->strategy == QUEUE_STRATEGY_RINGALL) {
struct ast_party_connected_line connected;
+
ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", ochan_name, inchan_name);
ast_party_connected_line_set_init(&connected, &o->connected);
ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
ast_party_connected_line_set(&o->connected, &connected, NULL);
ast_party_connected_line_free(&connected);
o->pending_connected_update = 1;
- } else {
- if (ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
- ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
- }
+ break;
+ }
+
+ /*
+ * Prevent using the CallerID from the outgoing channel since we
+ * got a connected line update from it.
+ */
+ o->dial_callerid_absent = 1;
+
+ if (ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
+ ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
}
break;
case AST_CONTROL_AOC:
@@ -3754,13 +3803,22 @@
}
break;
case AST_CONTROL_REDIRECTING:
- if (!update_connectedline) {
- ast_verb(3, "Redirecting update to %s prevented\n", inchan_name);
- } else if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
- ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ochan_name, inchan_name);
- if (ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
- ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
- }
+ if (qe->parent->strategy == QUEUE_STRATEGY_RINGALL) {
+ /*
+ * Redirecting updates to the caller make sense only on single
+ * call at a time strategies.
+ */
+ break;
+ }
+ if (o->block_connected_update) {
+ ast_verb(3, "Redirecting update to %s prevented\n",
+ inchan_name);
+ break;
+ }
+ ast_verb(3, "%s redirecting info has changed, passing it to %s\n",
+ ochan_name, inchan_name);
+ if (ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
+ ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
}
break;
default:
@@ -3799,6 +3857,14 @@
}
return NULL;
}
+
+ /*!
+ * \todo
+ * XXX Queue like Dial really should send any connected line
+ * updates (AST_CONTROL_CONNECTED_LINE) from the caller to each
+ * ringing queue member.
+ */
+
if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass.integer == '*')) {
ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer);
*to = 0;
@@ -4233,6 +4299,7 @@
ast_channel_lock(qe->chan);
if (!(ds = ast_datastore_alloc(&queue_transfer_info, NULL))) {
ast_channel_unlock(qe->chan);
+ ast_free(qtds);
ast_log(LOG_WARNING, "Unable to create transfer datastore. queue_log will not show attended transfer\n");
return NULL;
}
@@ -4336,7 +4403,7 @@
char *p;
char vars[2048];
int forwardsallowed = 1;
- int update_connectedline = 1;
+ int block_connected_line = 0;
int callcompletedinsl;
struct ao2_iterator memi;
struct ast_datastore *datastore, *transfer_ds;
@@ -4403,7 +4470,7 @@
forwardsallowed = 0;
break;
case 'I':
- update_connectedline = 0;
+ block_connected_line = 1;
break;
case 'x':
ast_set_flag(&(bridge_config.features_callee), AST_FEATURE_AUTOMIXMON);
@@ -4503,17 +4570,18 @@
AST_LIST_UNLOCK(dialed_interfaces);
}
- ast_channel_lock(qe->chan);
/*
* Seed the callattempt's connected line information with previously
* acquired connected line info from the queued channel. The
* previously acquired connected line info could have been set
* through the CONNECTED_LINE dialplan function.
*/
+ ast_channel_lock(qe->chan);
ast_party_connected_line_copy(&tmp->connected, &qe->chan->connected);
ast_channel_unlock(qe->chan);
- tmp->stillgoing = -1;
+ tmp->block_connected_update = block_connected_line;
+ tmp->stillgoing = 1;
tmp->member = cur;/* Place the reference for cur into callattempt. */
tmp->lastcall = cur->lastcall;
tmp->lastqueue = cur->lastqueue;
@@ -4555,7 +4623,9 @@
++qe->pending;
ao2_unlock(qe->parent);
ring_one(qe, outgoing, &numbusies);
- lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed, update_connectedline);
+ lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies,
+ ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT),
+ forwardsallowed);
/* The ast_channel_datastore_remove() function could fail here if the
* datastore was moved to another channel during a masquerade. If this is
* the case, don't free the datastore here because later, when the channel
@@ -4631,7 +4701,9 @@
res2 |= ast_safe_sleep(peer, qe->parent->memberdelay * 1000);
}
if (!res2 && announce) {
- play_file(peer, announce);
+ if (play_file(peer, announce) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", announce, peer->name);
+ }
}
if (!res2 && qe->parent->reportholdtime) {
if (!play_file(peer, qe->parent->sound_reporthold)) {
@@ -4642,11 +4714,15 @@
holdtimesecs = abs((now - qe->start) % 60);
if (holdtime > 0) {
ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
- play_file(peer, qe->parent->sound_minutes);
+ if (play_file(peer, qe->parent->sound_minutes) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_minutes, peer->name);
+ }
}
if (holdtimesecs > 1) {
ast_say_number(peer, holdtimesecs, AST_DIGIT_ANY, peer->language, NULL);
- play_file(peer, qe->parent->sound_seconds);
+ if (play_file(peer, qe->parent->sound_seconds) < 0) {
+ ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_seconds, peer->name);
+ }
}
}
}
@@ -5916,6 +5992,8 @@
set_queue_result(chan, reason);
return 0;
}
+ ast_assert(qe.parent != NULL);
+
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ENTERQUEUE", "%s|%s|%d",
S_OR(args.url, ""),
S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
@@ -6070,12 +6148,13 @@
if (reason != QUEUE_UNKNOWN)
set_queue_result(chan, reason);
- if (qe.parent) {
- /* every queue_ent is given a reference to it's parent call_queue when it joins the queue.
- * This ref must be taken away right before the queue_ent is destroyed. In this case
- * the queue_ent is about to be returned on the stack */
- qe.parent = queue_unref(qe.parent);
- }
+ /*
+ * every queue_ent is given a reference to it's parent
+ * call_queue when it joins the queue. This ref must be taken
+ * away right before the queue_ent is destroyed. In this case
+ * the queue_ent is about to be returned on the stack
+ */
+ qe.parent = queue_unref(qe.parent);
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_record.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/file.h"
#include "asterisk/pbx.h"
@@ -414,12 +414,14 @@
out:
if ((silence > 0) && rfmt) {
res = ast_set_read_format(chan, rfmt);
- if (res)
+ if (res) {
ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
- if (sildet)
- ast_dsp_free(sildet);
+ }
}
+ if (sildet) {
+ ast_dsp_free(sildet);
+ }
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_stack.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358810 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368308 $")
#include "asterisk/pbx.h"
#include "asterisk/module.h"
@@ -370,9 +370,20 @@
{
struct ast_datastore *stack_store;
AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
- struct gosub_stack_frame *newframe, *lastframe;
- char argname[15], *tmp = ast_strdupa(data), *label, *endparen;
- int i, max_argc = 0;
+ struct gosub_stack_frame *newframe;
+ struct gosub_stack_frame *lastframe;
+ char argname[15];
+ char *parse;
+ char *label;
+ char *caller_id;
+ char *orig_context;
+ char *orig_exten;
+ char *dest_context;
+ char *dest_exten;
+ int orig_priority;
+ int dest_priority;
+ int i;
+ int max_argc = 0;
AST_DECLARE_APP_ARGS(args2,
AST_APP_ARG(argval)[100];
);
@@ -382,26 +393,83 @@
return -1;
}
+ /*
+ * Separate the arguments from the label
+ *
+ * NOTE: You cannot use ast_app_separate_args for this, because
+ * '(' cannot be used as a delimiter.
+ */
+ parse = ast_strdupa(data);
+ label = strsep(&parse, "(");
+ if (parse) {
+ char *endparen;
+
+ endparen = strrchr(parse, ')');
+ if (endparen) {
+ *endparen = '\0';
+ } else {
+ ast_log(LOG_WARNING, "Ouch. No closing paren: '%s'?\n", data);
+ }
+ AST_STANDARD_RAW_ARGS(args2, parse);
+ } else {
+ args2.argc = 0;
+ }
+
ast_channel_lock(chan);
+ orig_context = ast_strdupa(chan->context);
+ orig_exten = ast_strdupa(chan->exten);
+ orig_priority = chan->priority;
+ ast_channel_unlock(chan);
+
+ if (ast_parseable_goto(chan, label)) {
+ ast_log(LOG_ERROR, "%s address is invalid: '%s'\n", app_gosub, data);
+ goto error_exit;
+ }
+
+ ast_channel_lock(chan);
+ dest_context = ast_strdupa(chan->context);
+ dest_exten = ast_strdupa(chan->exten);
+ dest_priority = chan->priority;
+ if (ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP)) {
+ ++dest_priority;
+ }
+ caller_id = S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL);
+ if (caller_id) {
+ caller_id = ast_strdupa(caller_id);
+ }
+ ast_channel_unlock(chan);
+
+ if (!ast_exists_extension(chan, dest_context, dest_exten, dest_priority, caller_id)) {
+ ast_log(LOG_ERROR, "Attempt to reach a non-existent destination for %s: (Context:%s, Extension:%s, Priority:%d)\n",
+ app_gosub, dest_context, dest_exten, dest_priority);
+ goto error_exit;
+ }
+
+ /* Now we know that we're going to a new location */
+
+ ast_channel_lock(chan);
+
+ /* Find stack datastore return list. */
if (!(stack_store = ast_channel_datastore_find(chan, &stack_info, NULL))) {
- ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", chan->name);
+ ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n",
+ chan->name);
stack_store = ast_datastore_alloc(&stack_info, NULL);
if (!stack_store) {
- ast_log(LOG_ERROR, "Unable to allocate new datastore. Gosub will fail.\n");
- ast_channel_unlock(chan);
- return -1;
+ ast_log(LOG_ERROR, "Unable to allocate new datastore. %s failed.\n",
+ app_gosub);
+ goto error_exit_locked;
}
oldlist = ast_calloc(1, sizeof(*oldlist));
if (!oldlist) {
- ast_log(LOG_ERROR, "Unable to allocate datastore list head. Gosub will fail.\n");
+ ast_log(LOG_ERROR, "Unable to allocate datastore list head. %s failed.\n",
+ app_gosub);
ast_datastore_free(stack_store);
- ast_channel_unlock(chan);
- return -1;
+ goto error_exit_locked;
}
+ AST_LIST_HEAD_INIT(oldlist);
stack_store->data = oldlist;
- AST_LIST_HEAD_INIT(oldlist);
ast_channel_datastore_add(chan, stack_store);
} else {
oldlist = stack_store->data;
@@ -411,53 +479,18 @@
max_argc = lastframe->arguments;
}
- /* Separate the arguments from the label */
- /* NOTE: you cannot use ast_app_separate_args for this, because '(' cannot be used as a delimiter. */
- label = strsep(&tmp, "(");
- if (tmp) {
- endparen = strrchr(tmp, ')');
- if (endparen)
- *endparen = '\0';
- else
- ast_log(LOG_WARNING, "Ouch. No closing paren: '%s'?\n", (char *)data);
- AST_STANDARD_RAW_ARGS(args2, tmp);
- } else
- args2.argc = 0;
-
- /* Mask out previous arguments in this invocation */
+ /* Mask out previous Gosub arguments in this invocation */
if (args2.argc > max_argc) {
max_argc = args2.argc;
}
- /* Create the return address, but don't save it until we know that the Gosub destination exists */
- newframe = gosub_allocate_frame(chan->context, chan->exten, chan->priority + 1, max_argc);
-
+ /* Create the return address */
+ newframe = gosub_allocate_frame(orig_context, orig_exten, orig_priority + 1, max_argc);
if (!newframe) {
- ast_channel_unlock(chan);
- return -1;
- }
-
- if (ast_parseable_goto(chan, label)) {
- ast_log(LOG_ERROR, "Gosub address is invalid: '%s'\n", (char *)data);
- ast_free(newframe);
- ast_channel_unlock(chan);
- return -1;
- }
-
- if (!ast_exists_extension(chan, chan->context, chan->exten,
- ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? chan->priority + 1 : chan->priority,
- S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
- ast_log(LOG_ERROR, "Attempt to reach a non-existent destination for gosub: (Context:%s, Extension:%s, Priority:%d)\n",
- chan->context, chan->exten, ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? chan->priority + 1 : chan->priority);
- ast_copy_string(chan->context, newframe->context, sizeof(chan->context));
- ast_copy_string(chan->exten, newframe->extension, sizeof(chan->exten));
- chan->priority = newframe->priority - 1;
- ast_free(newframe);
- ast_channel_unlock(chan);
- return -1;
+ goto error_exit_locked;
}
- /* Now that we know for certain that we're going to a new location, set our arguments */
+ /* Set our arguments */
for (i = 0; i < max_argc; i++) {
snprintf(argname, sizeof(argname), "ARG%d", i + 1);
frame_set_var(chan, newframe, argname, i < args2.argc ? args2.argval[i] : "");
@@ -467,13 +500,23 @@
frame_set_var(chan, newframe, "ARGC", argname);
/* And finally, save our return address */
- oldlist = stack_store->data;
AST_LIST_LOCK(oldlist);
AST_LIST_INSERT_HEAD(oldlist, newframe, entries);
AST_LIST_UNLOCK(oldlist);
ast_channel_unlock(chan);
return 0;
+
+error_exit:
+ ast_channel_lock(chan);
+
+error_exit_locked:
+ /* Restore the original dialplan location. */
+ ast_copy_string(chan->context, orig_context, sizeof(chan->context));
+ ast_copy_string(chan->exten, orig_exten, sizeof(chan->exten));
+ chan->priority = orig_priority;
+ ast_channel_unlock(chan);
+ return -1;
}
static int gosubif_exec(struct ast_channel *chan, const char *data)
@@ -764,8 +807,15 @@
struct ast_pbx *pbx = chan->pbx;
struct ast_pbx_args args;
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
- AST_LIST_HEAD(, gosub_stack_frame) *oldlist = stack_store->data;
- struct gosub_stack_frame *cur = AST_LIST_FIRST(oldlist);
+ AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
+ struct gosub_stack_frame *cur;
+ if (!stack_store) {
+ ast_log(LOG_WARNING, "No GoSub stack remaining after AGI GoSub execution.\n");
+ ast_free(gosub_args);
+ return RESULT_FAILURE;
+ }
+ oldlist = stack_store->data;
+ cur = AST_LIST_FIRST(oldlist);
cur->is_agi = 1;
memset(&args, 0, sizeof(args));
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/apps/app_voicemail.c
^
|
@@ -91,7 +91,7 @@
#endif
#endif
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362201 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369690 $")
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
#include <sys/time.h>
@@ -1758,25 +1758,28 @@
static int vm_allocate_dh(struct vm_state *vms, struct ast_vm_user *vmu, int count_msg) {
int arraysize = (vmu->maxmsg > count_msg ? vmu->maxmsg : count_msg);
- if (!vms->dh_arraysize) {
- /* initial allocation */
+
+ /* remove old allocation */
+ if (vms->deleted) {
+ ast_free(vms->deleted);
+ vms->deleted = NULL;
+ }
+ if (vms->heard) {
+ ast_free(vms->heard);
+ vms->heard = NULL;
+ }
+ vms->dh_arraysize = 0;
+
+ if (arraysize > 0) {
if (!(vms->deleted = ast_calloc(arraysize, sizeof(int)))) {
return -1;
}
if (!(vms->heard = ast_calloc(arraysize, sizeof(int)))) {
+ ast_free(vms->deleted);
+ vms->deleted = NULL;
return -1;
}
vms->dh_arraysize = arraysize;
- } else if (vms->dh_arraysize < arraysize) {
- if (!(vms->deleted = ast_realloc(vms->deleted, arraysize * sizeof(int)))) {
- return -1;
- }
- if (!(vms->heard = ast_realloc(vms->heard, arraysize * sizeof(int)))) {
- return -1;
- }
- memset(vms->deleted, 0, arraysize * sizeof(int));
- memset(vms->heard, 0, arraysize * sizeof(int));
- vms->dh_arraysize = arraysize;
}
return 0;
@@ -4563,7 +4566,7 @@
}
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
- ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+ ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
fprintf(p, "Date: %s" ENDL, date);
/* Set date format for voicemail mail */
@@ -4921,7 +4924,7 @@
snprintf(who, sizeof(who), "%s@%s", srcemail, host);
}
snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
- ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+ ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
fprintf(p, "Date: %s\n", date);
/* Reformat for custom pager format */
@@ -5740,8 +5743,9 @@
char e[2] = "";
e[0] = *code;
if (strchr(ecodes, e[0]) == NULL
- && ast_canmatch_extension(chan, chan->context, e, 1,
- S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
+ && ast_canmatch_extension(chan,
+ (!ast_strlen_zero(options->exitcontext) ? options->exitcontext : chan->context),
+ e, 1, S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
strncat(ecodes, e, sizeof(ecodes) - strlen(ecodes) - 1);
}
}
@@ -5836,11 +5840,12 @@
/* Allow all other digits to exit Voicemail and return to the dialplan */
if (ast_test_flag(options, OPT_DTMFEXIT) && res > 0) {
- if (!ast_strlen_zero(options->exitcontext))
+ if (!ast_strlen_zero(options->exitcontext)) {
ast_copy_string(chan->context, options->exitcontext, sizeof(chan->context));
+ }
free_user(vmu);
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT");
ast_free(tmp);
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT");
return res;
}
@@ -6565,9 +6570,15 @@
name = "Unknown Caller";
/* If deleted, show "undeleted" */
-
- if (vms->deleted[vms->curmsg])
- keys[1] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 11);
+#ifdef IMAP_STORAGE
+ ast_mutex_lock(&vms->lock);
+#endif
+ if (vms->deleted[vms->curmsg]) {
+ keys[1] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 11);
+ }
+#ifdef IMAP_STORAGE
+ ast_mutex_unlock(&vms->lock);
+#endif
/* Except "Exit" */
keys[5] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 5);
@@ -6620,8 +6631,15 @@
}
/* If deleted, show "undeleted" */
- if (vms->deleted[vms->curmsg])
+#ifdef IMAP_STORAGE
+ ast_mutex_lock(&vms->lock);
+#endif
+ if (vms->deleted[vms->curmsg]) {
keys[1] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 11);
+ }
+#ifdef IMAP_STORAGE
+ ast_mutex_unlock(&vms->lock);
+#endif
/* Except "Exit" */
keys[5] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 5);
@@ -6890,7 +6908,10 @@
strncat(vms->introfn, "intro", sizeof(vms->introfn));
ast_play_and_wait(chan, INTRO);
ast_play_and_wait(chan, "beep");
- play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag);
+ cmd = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag);
+ if (cmd == -1) {
+ break;
+ }
cmd = 't';
#else
@@ -7800,8 +7821,12 @@
if (!res) {
make_file(vms->fn, sizeof(vms->fn), vms->curdir, vms->curmsg);
+#ifdef IMAP_STORAGE
+ ast_mutex_lock(&vms->lock);
+#endif
vms->heard[vms->curmsg] = 1;
#ifdef IMAP_STORAGE
+ ast_mutex_unlock(&vms->lock);
/*IMAP storage stores any prepended message from a forward
* as a separate file from the rest of the message
*/
@@ -8016,6 +8041,7 @@
}
ast_unlock_path(vms->curdir);
#else /* defined(IMAP_STORAGE) */
+ ast_mutex_lock(&vms->lock);
if (vms->deleted) {
/* Since we now expunge after each delete, deleting in reverse order
* ensures that no reordering occurs between each step. */
@@ -8030,12 +8056,18 @@
#endif
done:
- if (vms->deleted && last_msg_idx) {
+ if (vms->deleted) {
ast_free(vms->deleted);
+ vms->deleted = NULL;
}
- if (vms->heard && last_msg_idx) {
+ if (vms->heard) {
ast_free(vms->heard);
+ vms->heard = NULL;
}
+ vms->dh_arraysize = 0;
+#ifdef IMAP_STORAGE
+ ast_mutex_unlock(&vms->lock);
+#endif
return 0;
}
@@ -9130,14 +9162,25 @@
res = ast_play_and_wait(chan, "vm-next");
}
if (!res) {
- if (!vms->deleted[vms->curmsg])
+ int curmsg_deleted;
+#ifdef IMAP_STORAGE
+ ast_mutex_lock(&vms->lock);
+#endif
+ curmsg_deleted = vms->deleted[vms->curmsg];
+#ifdef IMAP_STORAGE
+ ast_mutex_unlock(&vms->lock);
+#endif
+ if (!curmsg_deleted) {
res = ast_play_and_wait(chan, "vm-delete");
- else
+ } else {
res = ast_play_and_wait(chan, "vm-undelete");
- if (!res)
+ }
+ if (!res) {
res = ast_play_and_wait(chan, "vm-toforward");
- if (!res)
+ }
+ if (!res) {
res = ast_play_and_wait(chan, "vm-savemessage");
+ }
}
}
if (!res) {
@@ -9455,7 +9498,10 @@
retries = 0;
RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
if (ast_fileexists(prefile, NULL, NULL) <= 0) {
- play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
+ cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
+ if (cmd == -1) {
+ break;
+ }
cmd = 't';
} else {
switch (cmd) {
@@ -10171,6 +10217,7 @@
}
vms.starting = 1;
+ vms.curmsg = 0;
break;
case '3': /* Advanced options */
ast_test_suite_event_notify("ADVOPTIONS", "Message: entering advanced options menu");
@@ -11162,13 +11209,15 @@
AST_LIST_UNLOCK(&users);
return CLI_FAILURE;
}
- if (a->argc == 3)
+ if (!context) {
ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
- else {
+ } else {
int count = 0;
AST_LIST_TRAVERSE(&users, vmu, list) {
- if (!strcmp(context, vmu->context))
+ if (!strcmp(context, vmu->context)) {
count++;
+ break;
+ }
}
if (count) {
ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg");
@@ -11182,7 +11231,7 @@
int newmsgs = 0, oldmsgs = 0;
char count[12], tmp[256] = "";
- if ((a->argc == 3) || ((a->argc == 5) && !strcmp(context, vmu->context))) {
+ if (!context || !strcmp(context, vmu->context)) {
snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
inboxcount(tmp, &newmsgs, &oldmsgs);
snprintf(count, sizeof(count), "%d", newmsgs);
@@ -11517,11 +11566,21 @@
static void mwi_unsub_event_cb(const struct ast_event *event, void *userdata)
{
uint32_t u, *uniqueid = ast_calloc(1, sizeof(*uniqueid));
- if (ast_event_get_type(event) != AST_EVENT_UNSUB)
+
+ if (!uniqueid) {
+ ast_log(LOG_ERROR, "Unable to allocate memory for uniqueid\n");
return;
+ }
- if (ast_event_get_ie_uint(event, AST_EVENT_IE_EVENTTYPE) != AST_EVENT_MWI)
+ if (ast_event_get_type(event) != AST_EVENT_UNSUB) {
+ ast_free(uniqueid);
+ return;
+ }
+
+ if (ast_event_get_ie_uint(event, AST_EVENT_IE_EVENTTYPE) != AST_EVENT_MWI) {
+ ast_free(uniqueid);
return;
+ }
u = ast_event_get_ie_uint(event, AST_EVENT_IE_UNIQUEID);
*uniqueid = u;
@@ -11555,6 +11614,7 @@
static void start_poll_thread(void)
{
+ int errcode;
mwi_sub_sub = ast_event_subscribe(AST_EVENT_SUB, mwi_sub_event_cb, "Voicemail MWI subscription", NULL,
AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_MWI,
AST_EVENT_IE_END);
@@ -11568,7 +11628,9 @@
poll_thread_run = 1;
- ast_pthread_create(&poll_thread, NULL, mb_poll_thread, NULL);
+ if ((errcode = ast_pthread_create(&poll_thread, NULL, mb_poll_thread, NULL))) {
+ ast_log(LOG_ERROR, "Could not create thread: %s\n", strerror(errcode));
+ }
}
static void stop_poll_thread(void)
@@ -12503,8 +12565,10 @@
const char *val = ast_variable_retrieve(pwconf, "general", "password");
if (val) {
ast_copy_string(password, val, passwordlen);
- return;
+ ast_config_destroy(pwconf);
+ return;
}
+ ast_config_destroy(pwconf);
}
ast_log(LOG_NOTICE, "Failed reading voicemail password from %s, using secret from config file\n", secretfn);
}
@@ -12513,26 +12577,33 @@
struct ast_config *conf;
struct ast_category *cat;
struct ast_variable *var;
+ int res = -1;
- if (!(conf=ast_config_new())) {
+ if (!(conf = ast_config_new())) {
ast_log(LOG_ERROR, "Error creating new config structure\n");
- return -1;
+ return res;
}
- if (!(cat=ast_category_new("general","",1))) {
+ if (!(cat = ast_category_new("general", "", 1))) {
ast_log(LOG_ERROR, "Error creating new category structure\n");
- return -1;
+ ast_config_destroy(conf);
+ return res;
}
- if (!(var=ast_variable_new("password",password,""))) {
+ if (!(var = ast_variable_new("password", password, ""))) {
ast_log(LOG_ERROR, "Error creating new variable structure\n");
- return -1;
+ ast_config_destroy(conf);
+ ast_category_destroy(cat);
+ return res;
}
- ast_category_append(conf,cat);
- ast_variable_append(cat,var);
- if (ast_config_text_file_save(secretfn, conf, "app_voicemail")) {
+ ast_category_append(conf, cat);
+ ast_variable_append(cat, var);
+ if (!ast_config_text_file_save(secretfn, conf, "app_voicemail")) {
+ res = 0;
+ } else {
ast_log(LOG_ERROR, "Error writing voicemail password to %s\n", secretfn);
- return -1;
}
- return 0;
+
+ ast_config_destroy(conf);
+ return res;
}
static int vmsayname_exec(struct ast_channel *chan, const char *data)
|
[-]
[+]
|
Added |
asterisk-1.8.14.1.tar.xz/asterisk-1.8.14.1-summary.html
^
|
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.8.14.1</title></head>
+<body>
+<h1 align="center"><a name="top">Release Summary</a></h1>
+<h3 align="center">asterisk-1.8.14.1</h3>
+<h3 align="center">Date: 2012-07-16</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.14.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>
+3 bebuild<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=370078">370078</a></td><td>bebuild</td><td>Create 1.8.14.1</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=370104">370104</a></td><td>bebuild</td><td>Merge 369731 for 1.8.14.1</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=370107">370107</a></td><td>bebuild</td><td>Update 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 | 16 +
+asterisk-1.8.14.0-summary.html | 437 -------------------------------
+asterisk-1.8.14.0-summary.txt | 573 -----------------------------------------
+main/tcptls.c | 3
+5 files changed, 17 insertions(+), 1014 deletions(-)
+</pre><br/>
+<hr/>
+</body>
+</html>
|
[-]
[+]
|
Added |
asterisk-1.8.14.1.tar.xz/asterisk-1.8.14.1-summary.txt
^
|
@@ -0,0 +1,90 @@
+ Release Summary
+
+ asterisk-1.8.14.1
+
+ Date: 2012-07-16
+
+ <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.14.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
+ 3 bebuild
+
+ ----------------------------------------------------------------------
+
+ 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 |
+ |-----------+----------+----------------------------+--------------------|
+ | 370078 | bebuild | Create 1.8.14.1 | |
+ |-----------+----------+----------------------------+--------------------|
+ | 370104 | bebuild | Merge 369731 for 1.8.14.1 | |
+ |-----------+----------+----------------------------+--------------------|
+ | 370107 | bebuild | Update 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 | 16 +
+ asterisk-1.8.14.0-summary.html | 437 -------------------------------
+ asterisk-1.8.14.0-summary.txt | 573 -----------------------------------------
+ main/tcptls.c | 3
+ 5 files changed, 17 insertions(+), 1014 deletions(-)
+
+ ----------------------------------------------------------------------
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/build_tools/make_version
^
|
@@ -7,6 +7,7 @@
BRANCH=0
TEAM=0
TAG=0
+ FEATURE=0
REV=`svnversion -c ${1} | cut -d: -f2`
@@ -40,6 +41,9 @@
else
RESULT="${RESULT}-${PART}"
fi
+ if [ ${FEATURE} != 0 ] ; then
+ RESULT="${RESULT}-${FEATURE_NAME}"
+ fi
break
fi
@@ -52,6 +56,12 @@
continue
fi
+ if [ "${PART}" = "certified" ] ; then
+ FEATURE=1
+ FEATURE_NAME="cert"
+ continue
+ fi
+
if [ "${PART}" = "branches" ] ; then
BRANCH=1
RESULT="branch"
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_agent.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362204 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <sys/socket.h>
#include <fcntl.h>
@@ -517,21 +517,27 @@
/*!
* Deletes an agent after doing some clean up.
* Further documentation: How safe is this function ? What state should the agent be to be cleaned.
+ *
+ * \warning XXX This function seems to be very unsafe.
+ * Potential for double free and use after free among other
+ * problems.
+ *
* \param p Agent to be deleted.
* \returns Always 0.
*/
static int agent_cleanup(struct agent_pvt *p)
{
- struct ast_channel *chan = NULL;
+ struct ast_channel *chan;
+
ast_mutex_lock(&p->lock);
chan = p->owner;
p->owner = NULL;
- chan->tech_pvt = NULL;
/* Release ownership of the agent to other threads (presumably running the login app). */
p->app_sleep_cond = 1;
p->app_lock_flag = 0;
ast_cond_signal(&p->app_complete_cond);
if (chan) {
+ chan->tech_pvt = NULL;
chan = ast_channel_release(chan);
}
if (p->dead) {
@@ -540,7 +546,9 @@
ast_cond_destroy(&p->app_complete_cond);
ast_cond_destroy(&p->login_wait_cond);
ast_free(p);
- }
+ } else {
+ ast_mutex_unlock(&p->lock);
+ }
return 0;
}
@@ -668,7 +676,9 @@
break;
case AST_FRAME_DTMF_END:
if (!p->acknowledged && (f->subclass.integer == p->acceptdtmf)) {
- ast_verb(3, "%s acknowledged\n", p->chan->name);
+ if (p->chan) {
+ ast_verb(3, "%s acknowledged\n", p->chan->name);
+ }
p->acknowledged = 1;
ast_frfree(f);
f = &answer_frame;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_dahdi.c
^
|
@@ -49,7 +49,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 363730 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368644 $")
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <pthread.h>
@@ -7871,6 +7871,9 @@
struct ast_frame *f;
idx = dahdi_get_index(ast, p, 0);
+ if (idx < 0) {
+ return &ast_null_frame;
+ }
mysig = p->sig;
if (p->outsigmod > -1)
mysig = p->outsigmod;
@@ -7884,8 +7887,6 @@
p->subs[idx].f.data.ptr = NULL;
f = &p->subs[idx].f;
- if (idx < 0)
- return &p->subs[idx].f;
if (p->fake_event) {
res = p->fake_event;
p->fake_event = 0;
@@ -7965,6 +7966,7 @@
#else
ast_log(LOG_WARNING, "Received bits changed on %s signalling?\n", sig2str(p->sig));
#endif
+ break;
case DAHDI_EVENT_PULSE_START:
/* Stop tone if there's a pulse start and the PBX isn't started */
if (!ast->pbx)
@@ -8516,8 +8518,18 @@
ast_log(LOG_WARNING, "Unable to allocate three-way subchannel\n");
goto winkflashdone;
}
- /* Make new channel */
+
+ /*
+ * Make new channel
+ *
+ * We cannot hold the p or ast locks while creating a new
+ * channel.
+ */
+ ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(ast);
chan = dahdi_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, NULL);
+ ast_channel_lock(ast);
+ ast_mutex_lock(&p->lock);
if (p->dahditrcallerid) {
if (!p->origcid_num)
p->origcid_num = ast_strdup(p->cid_num);
@@ -8852,7 +8864,9 @@
ast_debug(1, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
/* If it's not us, return NULL immediately */
if (ast != p->owner) {
- ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);
+ if (p->owner) {
+ ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);
+ }
f = &p->subs[idx].f;
return f;
}
@@ -9218,6 +9232,7 @@
if ((ast->_state == AST_STATE_UP) && !p->outgoing) {
/* Treat this as a "hangup" instead of a "busy" on the assumption that
a busy */
+ ast_frfree(f);
f = NULL;
}
} else if (f->frametype == AST_FRAME_DTMF_BEGIN
@@ -9243,7 +9258,8 @@
if (ast_tvdiff_ms(ast_tvnow(), p->waitingfordt) >= p->waitfordialtone ) {
p->waitingfordt.tv_sec = 0;
ast_log(LOG_WARNING, "Never saw dialtone on channel %d\n", p->channel);
- f=NULL;
+ ast_frfree(f);
+ f = NULL;
} else if (f->frametype == AST_FRAME_VOICE) {
f->frametype = AST_FRAME_NULL;
f->subclass.integer = 0;
@@ -9258,6 +9274,7 @@
ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
p->dop.dialstr[0] = '\0';
ast_mutex_unlock(&p->lock);
+ ast_frfree(f);
return NULL;
} else {
ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
@@ -11673,14 +11690,13 @@
count = 0;
for (i = iflist; i; i = i->next) {
ast_mutex_lock(&i->lock);
- if ((i->subs[SUB_REAL].dfd > -1) && i->sig && (!i->radio) && !(i->sig & SIG_MFCR2)) {
+ if (pfds && (i->subs[SUB_REAL].dfd > -1) && i->sig && (!i->radio) && !(i->sig & SIG_MFCR2)) {
if (analog_lib_handles(i->sig, i->radio, i->oprmode)) {
struct analog_pvt *p = i->sig_pvt;
- if (!p)
+ if (!p) {
ast_log(LOG_ERROR, "No sig_pvt?\n");
-
- if (!p->owner && !p->subs[SUB_REAL].owner) {
+ } else if (!p->owner && !p->subs[SUB_REAL].owner) {
/* This needs to be watched, as it lacks an owner */
pfds[count].fd = i->subs[SUB_REAL].dfd;
pfds[count].events = POLLPRI;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_iax2.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367965 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <sys/mman.h>
#include <dirent.h>
@@ -2404,19 +2404,20 @@
.sin_addr.s_addr = peercnt->addr,
};
- if (peercnt) {
- /* Container locked here since peercnt may be unlinked from list. If left unlocked,
- * peercnt_add could try and grab this entry from the table and modify it at the
- * "same time" this thread attemps to unlink it.*/
- ao2_lock(peercnts);
- peercnt->cur--;
- ast_debug(1, "ip callno count decremented to %d for %s\n", peercnt->cur, ast_inet_ntoa(sin.sin_addr));
- /* if this was the last connection from the peer remove it from table */
- if (peercnt->cur == 0) {
- ao2_unlink(peercnts, peercnt);/* decrements ref from table, last ref is left to scheduler */
- }
- ao2_unlock(peercnts);
+ /*
+ * Container locked here since peercnt may be unlinked from
+ * list. If left unlocked, peercnt_add could try and grab this
+ * entry from the table and modify it at the "same time" this
+ * thread attemps to unlink it.
+ */
+ ao2_lock(peercnts);
+ peercnt->cur--;
+ ast_debug(1, "ip callno count decremented to %d for %s\n", peercnt->cur, ast_inet_ntoa(sin.sin_addr));
+ /* if this was the last connection from the peer remove it from table */
+ if (peercnt->cur == 0) {
+ ao2_unlink(peercnts, peercnt);/* decrements ref from table, last ref is left to scheduler */
}
+ ao2_unlock(peercnts);
}
/*!
@@ -4400,11 +4401,13 @@
/* Whoops, we weren't supposed to exist! */
peer = peer_unref(peer);
break;
- }
+ }
} else if (!strcasecmp(tmp->name, "regseconds")) {
ast_get_time_t(tmp->value, ®seconds, 0, NULL);
} else if (!strcasecmp(tmp->name, "ipaddr")) {
- ast_sockaddr_parse(&peer->addr, tmp->value, PARSE_PORT_IGNORE);
+ if (!ast_sockaddr_parse(&peer->addr, tmp->value, PARSE_PORT_IGNORE)) {
+ ast_log(LOG_WARNING, "Failed to parse sockaddr '%s' for ipaddr of realtime peer '%s'\n", tmp->value, tmp->name);
+ }
} else if (!strcasecmp(tmp->name, "port")) {
ast_sockaddr_set_port(&peer->addr, atoi(tmp->value));
} else if (!strcasecmp(tmp->name, "host")) {
@@ -5287,7 +5290,7 @@
DEADLOCK_AVOIDANCE(&iaxsl[callno]);
pvt = iaxs[callno];
}
- if (!pvt->peercallno) {
+ if (!pvt || !pvt->peercallno) {
return -1;
}
}
@@ -5912,16 +5915,15 @@
The "genuine" distinction is needed because genuine frames must get a clock-based timestamp,
the others need a timestamp slaved to the voice frames so that they go in sequence
*/
- if (f) {
- if (f->frametype == AST_FRAME_VOICE) {
- voice = 1;
- delivery = &f->delivery;
- } else if (f->frametype == AST_FRAME_IAX) {
- genuine = 1;
- } else if (f->frametype == AST_FRAME_CNG) {
- p->notsilenttx = 0;
- }
+ if (f->frametype == AST_FRAME_VOICE) {
+ voice = 1;
+ delivery = &f->delivery;
+ } else if (f->frametype == AST_FRAME_IAX) {
+ genuine = 1;
+ } else if (f->frametype == AST_FRAME_CNG) {
+ p->notsilenttx = 0;
}
+
if (ast_tvzero(p->offset)) {
p->offset = ast_tvnow();
/* Round to nearest 20ms for nice looking traces */
@@ -6891,6 +6893,7 @@
} else {
ast_cli(a->fd, "Peer %s not registered\n", a->argv[2]);
}
+ peer_unref(p);
} else {
ast_cli(a->fd, "Peer unknown: %s. Not unregistered\n", a->argv[2]);
}
@@ -8671,6 +8674,7 @@
expiry = strrchr(data, ':');
if (!expiry) {
ast_log(LOG_NOTICE, "IAX/Registry astdb entry missing expiry: '%s'\n", data);
+ return;
}
*expiry++ = '\0';
@@ -9846,6 +9850,7 @@
}
varlist = ast_calloc(1, sizeof(*varlist));
if (!varlist) {
+ ast_datastore_free(variablestore);
ast_log(LOG_ERROR, "Unable to assign new variable '%s'\n", data);
return -1;
}
@@ -11644,6 +11649,7 @@
ast_mutex_destroy(&thread->init_lock);
ast_cond_destroy(&thread->init_cond);
ast_free(thread);
+ /* Ignore check_return warning from Coverity for ast_atomic_dec_and_test below */
ast_atomic_dec_and_test(&iaxactivethreadcount);
}
@@ -12222,7 +12228,10 @@
AST_LIST_UNLOCK(&idle_list);
}
}
- ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL);
+ if (ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL)) {
+ ast_log(LOG_ERROR, "Failed to create new thread!\n");
+ return -1;
+ }
ast_verb(2, "%d helper threads started\n", threadcount);
return 0;
}
@@ -13056,6 +13065,11 @@
ast_config_destroy(ucfg);
return 0;
}
+ if (!cfg) {
+ /* should have been able to load the config here */
+ ast_log(LOG_ERROR, "Unable to load config %s again\n", config_file);
+ return -1;
+ }
} else if (cfg == CONFIG_STATUS_FILEINVALID) {
ast_log(LOG_ERROR, "Config file %s is in an invalid format. Aborting.\n", config_file);
return 0;
@@ -13933,8 +13947,9 @@
} else if (!strncasecmp(colname, "codec[", 6)) {
char *codecnum, *ptr;
int codec = 0;
-
- codecnum = strchr(colname, '[');
+
+ /* skip over "codec" to the '[' */
+ codecnum = colname + 5;
*codecnum = '\0';
codecnum++;
if ((ptr = strchr(codecnum, ']'))) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_local.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365068 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365313 $")
#include <fcntl.h>
#include <sys/signal.h>
@@ -476,17 +476,16 @@
*
* \note it is assummed p is locked and reffed before entering this function
*/
-static void check_bridge(struct local_pvt *p)
+static void check_bridge(struct ast_channel *ast, struct local_pvt *p)
{
- struct ast_channel_monitor *tmp;
- struct ast_channel *chan = NULL;
- struct ast_channel *bridged_chan = NULL;
+ struct ast_channel *owner;
+ struct ast_channel *chan;
+ struct ast_channel *bridged_chan;
+ struct ast_frame *f;
/* Do a few conditional checks early on just to see if this optimization is possible */
- if (ast_test_flag(p, LOCAL_NO_OPTIMIZATION)) {
- return;
- }
- if (ast_test_flag(p, LOCAL_ALREADY_MASQED) || !p->chan || !p->owner) {
+ if (ast_test_flag(p, LOCAL_NO_OPTIMIZATION | LOCAL_ALREADY_MASQED)
+ || !p->chan || !p->owner) {
return;
}
@@ -502,7 +501,9 @@
/* since we had to unlock p to get the bridged chan, validate our
* data once again and verify the bridged channel is what we expect
* it to be in order to perform this optimization */
- if (ast_test_flag(p, LOCAL_ALREADY_MASQED) || !p->owner || !p->chan || (p->chan->_bridge != bridged_chan)) {
+ if (ast_test_flag(p, LOCAL_NO_OPTIMIZATION | LOCAL_ALREADY_MASQED)
+ || !p->chan || !p->owner
+ || (p->chan->_bridge != bridged_chan)) {
return;
}
@@ -511,73 +512,114 @@
frames on the owner channel (because they would be transferred to the
outbound channel during the masquerade)
*/
- if (p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */ && AST_LIST_EMPTY(&p->owner->readq)) {
- /* Masquerade bridged channel into owner */
- /* Lock everything we need, one by one, and give up if
- we can't get everything. Remember, we'll get another
- chance in just a little bit */
- if (!ast_channel_trylock(p->chan->_bridge)) {
- if (!ast_check_hangup(p->chan->_bridge)) {
- if (!ast_channel_trylock(p->owner)) {
- if (!ast_check_hangup(p->owner)) {
- if (p->owner->monitor && !p->chan->_bridge->monitor) {
- /* If a local channel is being monitored, we don't want a masquerade
- * to cause the monitor to go away. Since the masquerade swaps the monitors,
- * pre-swapping the monitors before the masquerade will ensure that the monitor
- * ends up where it is expected.
- */
- tmp = p->owner->monitor;
- p->owner->monitor = p->chan->_bridge->monitor;
- p->chan->_bridge->monitor = tmp;
- }
- if (p->chan->audiohooks) {
- struct ast_audiohook_list *audiohooks_swapper;
- audiohooks_swapper = p->chan->audiohooks;
- p->chan->audiohooks = p->owner->audiohooks;
- p->owner->audiohooks = audiohooks_swapper;
- }
-
- /* If any Caller ID was set, preserve it after masquerade like above. We must check
- * to see if Caller ID was set because otherwise we'll mistakingly copy info not
- * set from the dialplan and will overwrite the real channel Caller ID. The reason
- * for this whole preswapping action is because the Caller ID is set on the channel
- * thread (which is the to be masqueraded away local channel) before both local
- * channels are optimized away.
- */
- if (p->owner->caller.id.name.valid || p->owner->caller.id.number.valid
- || p->owner->caller.id.subaddress.valid || p->owner->caller.ani.name.valid
- || p->owner->caller.ani.number.valid || p->owner->caller.ani.subaddress.valid) {
- struct ast_party_caller tmp;
- tmp = p->owner->caller;
- p->owner->caller = p->chan->_bridge->caller;
- p->chan->_bridge->caller = tmp;
- }
- if (p->owner->redirecting.from.name.valid || p->owner->redirecting.from.number.valid
- || p->owner->redirecting.from.subaddress.valid || p->owner->redirecting.to.name.valid
- || p->owner->redirecting.to.number.valid || p->owner->redirecting.to.subaddress.valid) {
- struct ast_party_redirecting tmp;
- tmp = p->owner->redirecting;
- p->owner->redirecting = p->chan->_bridge->redirecting;
- p->chan->_bridge->redirecting = tmp;
- }
- if (p->owner->dialed.number.str || p->owner->dialed.subaddress.valid) {
- struct ast_party_dialed tmp;
- tmp = p->owner->dialed;
- p->owner->dialed = p->chan->_bridge->dialed;
- p->chan->_bridge->dialed = tmp;
- }
-
-
- ast_app_group_update(p->chan, p->owner);
- ast_channel_masquerade(p->owner, p->chan->_bridge);
- ast_set_flag(p, LOCAL_ALREADY_MASQED);
- }
- ast_channel_unlock(p->owner);
- }
- }
- ast_channel_unlock(p->chan->_bridge);
- }
+ if (!p->chan->_bridge /* Not ast_bridged_channel! Only go one step! */
+ || !AST_LIST_EMPTY(&p->owner->readq)
+ || ast != p->chan /* Sanity check (should always be false) */) {
+ return;
+ }
+
+ /* Masquerade bridged channel into owner */
+ /* Lock everything we need, one by one, and give up if
+ we can't get everything. Remember, we'll get another
+ chance in just a little bit */
+ if (ast_channel_trylock(p->chan->_bridge)) {
+ return;
+ }
+ if (ast_check_hangup(p->chan->_bridge) || ast_channel_trylock(p->owner)) {
+ ast_channel_unlock(p->chan->_bridge);
+ return;
+ }
+
+ /*
+ * At this point we have 4 locks:
+ * p, p->chan (same as ast), p->chan->_bridge, p->owner
+ *
+ * Flush a voice or video frame on the outbound channel to make
+ * the queue empty faster so we can get optimized out.
+ */
+ f = AST_LIST_FIRST(&p->chan->readq);
+ if (f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
+ AST_LIST_REMOVE_HEAD(&p->chan->readq, frame_list);
+ ast_frfree(f);
+ f = AST_LIST_FIRST(&p->chan->readq);
+ }
+
+ if (f
+ || ast_check_hangup(p->owner)
+ || ast_channel_masquerade(p->owner, p->chan->_bridge)) {
+ ast_channel_unlock(p->owner);
+ ast_channel_unlock(p->chan->_bridge);
+ return;
+ }
+
+ /* Masquerade got setup. */
+ ast_debug(4, "Masquerading %s <- %s\n",
+ p->owner->name, p->chan->_bridge->name);
+ if (p->owner->monitor && !p->chan->_bridge->monitor) {
+ struct ast_channel_monitor *tmp;
+
+ /* If a local channel is being monitored, we don't want a masquerade
+ * to cause the monitor to go away. Since the masquerade swaps the monitors,
+ * pre-swapping the monitors before the masquerade will ensure that the monitor
+ * ends up where it is expected.
+ */
+ tmp = p->owner->monitor;
+ p->owner->monitor = p->chan->_bridge->monitor;
+ p->chan->_bridge->monitor = tmp;
+ }
+ if (p->chan->audiohooks) {
+ struct ast_audiohook_list *audiohooks_swapper;
+ audiohooks_swapper = p->chan->audiohooks;
+ p->chan->audiohooks = p->owner->audiohooks;
+ p->owner->audiohooks = audiohooks_swapper;
+ }
+
+ /* If any Caller ID was set, preserve it after masquerade like above. We must check
+ * to see if Caller ID was set because otherwise we'll mistakingly copy info not
+ * set from the dialplan and will overwrite the real channel Caller ID. The reason
+ * for this whole preswapping action is because the Caller ID is set on the channel
+ * thread (which is the to be masqueraded away local channel) before both local
+ * channels are optimized away.
+ */
+ if (p->owner->caller.id.name.valid || p->owner->caller.id.number.valid
+ || p->owner->caller.id.subaddress.valid || p->owner->caller.ani.name.valid
+ || p->owner->caller.ani.number.valid || p->owner->caller.ani.subaddress.valid) {
+ struct ast_party_caller tmp;
+
+ tmp = p->owner->caller;
+ p->owner->caller = p->chan->_bridge->caller;
+ p->chan->_bridge->caller = tmp;
+ }
+ if (p->owner->redirecting.from.name.valid || p->owner->redirecting.from.number.valid
+ || p->owner->redirecting.from.subaddress.valid || p->owner->redirecting.to.name.valid
+ || p->owner->redirecting.to.number.valid || p->owner->redirecting.to.subaddress.valid) {
+ struct ast_party_redirecting tmp;
+
+ tmp = p->owner->redirecting;
+ p->owner->redirecting = p->chan->_bridge->redirecting;
+ p->chan->_bridge->redirecting = tmp;
+ }
+ if (p->owner->dialed.number.str || p->owner->dialed.subaddress.valid) {
+ struct ast_party_dialed tmp;
+
+ tmp = p->owner->dialed;
+ p->owner->dialed = p->chan->_bridge->dialed;
+ p->chan->_bridge->dialed = tmp;
}
+ ast_app_group_update(p->chan, p->owner);
+ ast_set_flag(p, LOCAL_ALREADY_MASQED);
+
+ ast_channel_unlock(p->owner);
+ ast_channel_unlock(p->chan->_bridge);
+
+ /* Do the masquerade now. */
+ owner = ast_channel_ref(p->owner);
+ ao2_unlock(p);
+ ast_channel_unlock(ast);
+ ast_do_masquerade(owner);
+ ast_channel_unref(owner);
+ ast_channel_lock(ast);
+ ao2_lock(p);
}
static struct ast_frame *local_read(struct ast_channel *ast)
@@ -600,14 +642,16 @@
ao2_lock(p);
isoutbound = IS_OUTBOUND(ast, p);
- if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
- check_bridge(p);
+ if (isoutbound
+ && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
+ check_bridge(ast, p);
}
if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
res = local_queue_frame(p, isoutbound, f, ast, 1);
} else {
- ast_debug(1, "Not posting to queue since already masked on '%s'\n", ast->name);
+ ast_debug(1, "Not posting to '%s' queue since already masqueraded out\n",
+ ast->name);
res = 0;
}
ao2_unlock(p);
@@ -701,11 +745,20 @@
} else {
/* Queue up a frame representing the indication as a control frame */
ao2_lock(p);
- isoutbound = IS_OUTBOUND(ast, p);
- f.subclass.integer = condition;
- f.data.ptr = (void*)data;
- f.datalen = datalen;
- res = local_queue_frame(p, isoutbound, &f, ast, 1);
+ /*
+ * Block -1 stop tones events if we are to be optimized out. We
+ * don't need a flurry of these events on a local channel chain
+ * when initially connected to slow the optimization process.
+ */
+ if (0 <= condition || ast_test_flag(p, LOCAL_NO_OPTIMIZATION)) {
+ isoutbound = IS_OUTBOUND(ast, p);
+ f.subclass.integer = condition;
+ f.data.ptr = (void *) data;
+ f.datalen = datalen;
+ res = local_queue_frame(p, isoutbound, &f, ast, 1);
+ } else {
+ ast_debug(4, "Blocked indication %d\n", condition);
+ }
ao2_unlock(p);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_sip.c
^
|
@@ -209,7 +209,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367965 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369690 $")
#include <signal.h>
#include <sys/signal.h>
@@ -3157,7 +3157,7 @@
int len = strlen(sip_methods[id].text);
int l_name = name ? strlen(name) : 0;
/* true if the string is long enough, and ends with whitespace, and matches */
- return (l_name >= len && name[len] < 33 &&
+ return (l_name >= len && name && name[len] < 33 &&
!strncasecmp(sip_methods[id].text, name, len));
}
@@ -3461,7 +3461,7 @@
}
ast_debug(1, "Target address %s is not local, substituting externaddr\n",
ast_sockaddr_stringify(them));
- } else if (p) {
+ } else {
/* no remapping, but we bind to a specific address, so use it. */
switch (p->socket.type) {
case SIP_TRANSPORT_TCP:
@@ -3492,8 +3492,6 @@
ast_sockaddr_set_port(us, ast_sockaddr_port(&bindaddr));
}
}
- } else if (!ast_sockaddr_is_any(&bindaddr)) {
- ast_sockaddr_copy(us, &bindaddr);
}
ast_debug(3, "Setting SIP_TRANSPORT_%s with address %s\n", get_transport(p->socket.type), ast_sockaddr_stringify(us));
}
@@ -3636,7 +3634,7 @@
pkt->retransid = -1; /* Kill this scheduler item */
- if (pkt->owner && pkt->method != SIP_OPTIONS && xmitres == 0) {
+ if (pkt->method != SIP_OPTIONS && xmitres == 0) {
if (pkt->is_fatal || sipdebug) { /* Tell us if it's critical or if we're debugging */
ast_log(LOG_WARNING, "Retransmission timeout reached on transmission %s for seqno %u (%s %s) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions\n"
"Packet timed out after %dms with no response\n",
@@ -3850,7 +3848,7 @@
ast_debug(3, "Re-scheduled destruction of SIP call %s\n", p->callid ? p->callid : "<unknown>");
append_history(p, "ReliableXmit", "timeout");
if (sscanf(p->lastmsg, "Tx: %30s", method_str) == 1 || sscanf(p->lastmsg, "Rx: %30s", method_str) == 1) {
- if (method_match(SIP_CANCEL, method_str) || method_match(SIP_BYE, method_str)) {
+ if (p->ongoing_reinvite || method_match(SIP_CANCEL, method_str) || method_match(SIP_BYE, method_str)) {
pvt_set_needdestroy(p, "autodestruct");
}
}
@@ -3864,16 +3862,17 @@
/* Reset schedule ID */
p->autokillid = -1;
-
/*
* Lock both the pvt and the channel safely so that we can queue up a frame.
*/
owner = sip_pvt_lock_full(p);
if (owner) {
- ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text);
+ ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s). Rescheduling destruction for 10000 ms\n", p->callid, sip_methods[p->method].text);
ast_queue_hangup_with_cause(owner, AST_CAUSE_PROTOCOL_ERROR);
ast_channel_unlock(owner);
ast_channel_unref(owner);
+ sip_pvt_unlock(p);
+ return 10000;
} else if (p->refer && !p->alreadygone) {
ast_debug(3, "Finally hanging up channel after transfer: %s\n", p->callid);
stop_media_flows(p);
@@ -6224,6 +6223,21 @@
return 0;
}
+static int reinvite_timeout(const void *data)
+{
+ struct sip_pvt *dialog = (struct sip_pvt *) data;
+ struct ast_channel *owner = sip_pvt_lock_full(dialog);
+ dialog->reinviteid = -1;
+ check_pendings(dialog);
+ if (owner) {
+ ast_channel_unlock(owner);
+ ast_channel_unref(owner);
+ }
+ ao2_unlock(dialog);
+ dialog_unref(dialog, "unref for reinvite timeout");
+ return 0;
+}
+
/*! \brief sip_hangup: Hangup SIP call
* Part of PBX interface, called from ast_hangup */
static int sip_hangup(struct ast_channel *ast)
@@ -6385,31 +6399,27 @@
ast_channel_unlock(bridge);
}
- if (p->do_history || oldowner) {
- if (p->rtp && (quality = ast_rtp_instance_get_quality(p->rtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
- if (p->do_history) {
- append_history(p, "RTCPaudio", "Quality:%s", quality);
- }
- if (oldowner) {
- pbx_builtin_setvar_helper(oldowner, "RTPAUDIOQOS", quality);
- }
+ /*
+ * The channel variables are set below just to get the AMI
+ * VarSet event because the channel is being hungup.
+ */
+ if (p->rtp && (quality = ast_rtp_instance_get_quality(p->rtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
+ if (p->do_history) {
+ append_history(p, "RTCPaudio", "Quality:%s", quality);
}
- if (p->vrtp && (quality = ast_rtp_instance_get_quality(p->vrtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
- if (p->do_history) {
- append_history(p, "RTCPvideo", "Quality:%s", quality);
- }
- if (oldowner) {
- pbx_builtin_setvar_helper(oldowner, "RTPVIDEOQOS", quality);
- }
+ pbx_builtin_setvar_helper(oldowner, "RTPAUDIOQOS", quality);
+ }
+ if (p->vrtp && (quality = ast_rtp_instance_get_quality(p->vrtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
+ if (p->do_history) {
+ append_history(p, "RTCPvideo", "Quality:%s", quality);
}
- if (p->trtp && (quality = ast_rtp_instance_get_quality(p->trtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
- if (p->do_history) {
- append_history(p, "RTCPtext", "Quality:%s", quality);
- }
- if (oldowner) {
- pbx_builtin_setvar_helper(oldowner, "RTPTEXTQOS", quality);
- }
+ pbx_builtin_setvar_helper(oldowner, "RTPVIDEOQOS", quality);
+ }
+ if (p->trtp && (quality = ast_rtp_instance_get_quality(p->trtp, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, quality_buf, sizeof(quality_buf)))) {
+ if (p->do_history) {
+ append_history(p, "RTCPtext", "Quality:%s", quality);
}
+ pbx_builtin_setvar_helper(oldowner, "RTPTEXTQOS", quality);
}
/* Send a hangup */
@@ -6423,8 +6433,16 @@
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
ast_clear_flag(&p->flags[0], SIP_NEEDREINVITE);
AST_SCHED_DEL_UNREF(sched, p->waitid, dialog_unref(p, "when you delete the waitid sched, you should dec the refcount for the stored dialog ptr"));
- if (sip_cancel_destroy(p))
+ if (sip_cancel_destroy(p)) {
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
+ }
+ /* If we have an ongoing reinvite, there is a chance that we have gotten a provisional
+ * response, but something weird has happened and we will never receive a final response.
+ * So, just in case, check for pending actions after a bit of time to trigger the pending
+ * bye that we are setting above */
+ if (p->ongoing_reinvite && p->reinviteid < 0) {
+ p->reinviteid = ast_sched_add(sched, 32 * p->timer_t1, reinvite_timeout, dialog_ref(p, "ref for reinvite_timeout"));
+ }
}
}
}
@@ -7125,6 +7143,8 @@
if (i->rtp) {
ast_channel_set_fd(tmp, 0, ast_rtp_instance_fd(i->rtp, 0));
ast_channel_set_fd(tmp, 1, ast_rtp_instance_fd(i->rtp, 1));
+ ast_rtp_instance_set_write_format(i->rtp, fmt);
+ ast_rtp_instance_set_read_format(i->rtp, fmt);
}
if (needvideo && i->vrtp) {
ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
@@ -7143,11 +7163,9 @@
tmp->writeformat = fmt;
tmp->rawwriteformat = fmt;
- ast_rtp_instance_set_write_format(i->rtp, fmt);
tmp->readformat = fmt;
tmp->rawreadformat = fmt;
- ast_rtp_instance_set_read_format(i->rtp, fmt);
tmp->tech_pvt = dialog_ref(i, "sip_new: set chan->tech_pvt to i");
@@ -7426,6 +7444,7 @@
if (f && (f->frametype == AST_FRAME_DTMF_BEGIN || f->frametype == AST_FRAME_DTMF_END) &&
(ast_test_flag(&p->flags[0], SIP_DTMF) != SIP_DTMF_RFC2833)) {
ast_debug(1, "Ignoring DTMF (%c) RTP frame because dtmfmode is not RFC2833\n", f->subclass.integer);
+ ast_frfree(f);
return &ast_null_frame;
}
@@ -7437,6 +7456,7 @@
if (!(f->subclass.codec & p->jointcapability)) {
ast_debug(1, "Bogus frame of format '%s' received from '%s'!\n",
ast_getformatname(f->subclass.codec), p->owner->name);
+ ast_frfree(f);
return &ast_null_frame;
}
ast_debug(1, "Oooh, format changed to %s\n",
@@ -7464,7 +7484,7 @@
}
}
}
-
+
return f;
}
@@ -7499,6 +7519,7 @@
if (ast_async_goto(ast, target_context, "fax", 1)) {
ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
}
+ ast_frfree(fr);
fr = &ast_null_frame;
} else {
ast_channel_lock(ast);
@@ -7510,6 +7531,7 @@
/* Only allow audio through if they sent progress with SDP, or if the channel is actually answered */
if (fr && fr->frametype == AST_FRAME_VOICE && p->invitestate != INV_EARLY_MEDIA && ast->_state != AST_STATE_UP) {
+ ast_frfree(fr);
fr = &ast_null_frame;
}
@@ -7693,6 +7715,7 @@
p->method = intended_method;
p->initid = -1;
p->waitid = -1;
+ p->reinviteid = -1;
p->autokillid = -1;
p->request_queue_sched_id = -1;
p->provisional_keepalive_sched_id = -1;
@@ -8253,7 +8276,7 @@
int portnum = 0;
enum sip_transport transport = SIP_TRANSPORT_UDP;
char buf[256] = "";
- char *username = NULL, *hostname = NULL, *secret = NULL, *authuser = NULL, *porta = NULL, *mailbox = NULL, *at = NULL;
+ char *username = NULL, *hostname = NULL, *secret = NULL, *authuser = NULL, *porta = NULL, *mailbox = NULL;
if (!value) {
return -1;
@@ -8261,13 +8284,12 @@
ast_copy_string(buf, value, sizeof(buf));
- if (!(at = strstr(buf, "@"))) {
- return -1;
- }
+ username = buf;
if ((hostname = strrchr(buf, '@'))) {
*hostname++ = '\0';
- username = buf;
+ } else {
+ return -1;
}
if ((secret = strchr(username, ':'))) {
@@ -8677,6 +8699,9 @@
}
/* No address for RTP, we're on hold */
+ /* Ensure hold flags are cleared so that overlapping flags do not conflict */
+ ast_clear_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD);
+
if (sendonly == 1) /* One directional hold (sendonly/recvonly) */
ast_set_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR);
else if (sendonly == 2) /* Inactive stream */
@@ -8755,7 +8780,7 @@
return ast_sockaddr_isnull(addr) || ast_sockaddr_is_any(addr);
}
-/*! \brief Process SIP SDP offer, select formats and activate RTP channels
+/*! \brief Process SIP SDP offer, select formats and activate media channels
If offer is rejected, we will not change any properties of the call
Return 0 on success, a negative value on errors.
Must be called after find_sdp().
@@ -8780,16 +8805,16 @@
struct ast_sockaddr videosa;
struct ast_sockaddr textsa;
struct ast_sockaddr imagesa;
- struct ast_sockaddr *sa = NULL; /*!< RTP Audio host IP */
- struct ast_sockaddr *vsa = NULL; /*!< RTP video host IP */
- struct ast_sockaddr *tsa = NULL; /*!< RTP text host IP */
- struct ast_sockaddr *isa = NULL; /*!< UDPTL host ip */
- int portno = -1; /*!< RTP Audio port number */
- int vportno = -1; /*!< RTP Video port number */
- int tportno = -1; /*!< RTP Text port number */
- int udptlportno = -1; /*!< UDPTL Image port number */
+ struct ast_sockaddr *sa = NULL; /*!< RTP audio destination IP address */
+ struct ast_sockaddr *vsa = NULL; /*!< RTP video destination IP address */
+ struct ast_sockaddr *tsa = NULL; /*!< RTP text destination IP address */
+ struct ast_sockaddr *isa = NULL; /*!< UDPTL image destination IP address */
+ int portno = -1; /*!< RTP audio destination port number */
+ int vportno = -1; /*!< RTP video destination port number */
+ int tportno = -1; /*!< RTP text destination port number */
+ int udptlportno = -1; /*!< UDPTL image destination port number */
- /* Peer capability is the capability in the SDP, non codec is RFC2833 DTMF (101) */
+ /* Peer capability is the capability in the SDP, non codec is RFC2833 DTMF (101) */
format_t peercapability = 0, vpeercapability = 0, tpeercapability = 0;
int peernoncodeccapability = 0, vpeernoncodeccapability = 0, tpeernoncodeccapability = 0;
@@ -8811,9 +8836,9 @@
int numberofports;
int numberofmediastreams = 0;
int last_rtpmap_codec = 0;
- int red_data_pt[10]; /* For T.140 red */
- int red_num_gen = 0; /* For T.140 red */
- char red_fmtp[100] = "empty"; /* For T.140 red */
+ int red_data_pt[10]; /* For T.140 RED */
+ int red_num_gen = 0; /* For T.140 RED */
+ char red_fmtp[100] = "empty"; /* For T.140 RED */
int debug = sip_debug_test_pvt(p);
/* START UNKNOWN */
@@ -8836,19 +8861,10 @@
memset(p->offered_media, 0, sizeof(p->offered_media));
-
/* default: novideo and notext set */
p->novideo = TRUE;
p->notext = TRUE;
- if (p->vrtp) {
- ast_rtp_codecs_payloads_clear(&newvideortp, NULL);
- }
-
- if (p->trtp) {
- ast_rtp_codecs_payloads_clear(&newtextrtp, NULL);
- }
-
/* Scan for the first media stream (m=) line to limit scanning of globals */
nextm = get_sdp_iterate(&next, req, "m");
if (ast_strlen_zero(nextm)) {
@@ -8892,11 +8908,9 @@
break;
}
- ast_debug(3, "Processing session-level SDP %c=%s... %s\n", type, value, (processed == TRUE)? "OK." : "UNSUPPORTED.");
+ ast_debug(3, "Processing session-level SDP %c=%s... %s\n", type, value, (processed == TRUE)? "OK." : "UNSUPPORTED OR FAILED.");
}
-
-
/* Scan media stream (m=) specific parameters loop */
while (!ast_strlen_zero(nextm)) {
int audio = FALSE;
@@ -8907,146 +8921,195 @@
char protocol[5] = {0,};
int x;
- numberofports = 1;
+ numberofports = 0;
len = -1;
start = next;
m = nextm;
iterator = next;
nextm = get_sdp_iterate(&next, req, "m");
- /* Search for audio media definition */
- if ((sscanf(m, "audio %30u/%30u RTP/%4s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
- (sscanf(m, "audio %30u RTP/%4s %n", &x, protocol, &len) == 2 && len > 0)) {
- if (x == 0) {
- ast_log(LOG_WARNING, "ignoring 'audio' media offer because port number is zero\n");
- continue;
- }
- if (!strcmp(protocol, "SAVP")) {
- secure_audio = 1;
- } else if (strcmp(protocol, "AVP")) {
- ast_log(LOG_WARNING, "unknown SDP media protocol in offer: %s\n", protocol);
- continue;
- }
- if (p->offered_media[SDP_AUDIO].order_offered) {
- ast_log(LOG_WARNING, "Multiple audio streams are not supported\n");
- return -3;
- }
- audio = TRUE;
- p->offered_media[SDP_AUDIO].order_offered = ++numberofmediastreams;
- portno = x;
-
- /* Scan through the RTP payload types specified in a "m=" line: */
- codecs = m + len;
- ast_copy_string(p->offered_media[SDP_AUDIO].codecs, codecs, sizeof(p->offered_media[SDP_AUDIO].codecs));
- for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
- if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
- ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
+ /* Check for 'audio' media offer */
+ if (strncmp(m, "audio ", 6) == 0) {
+ if ((sscanf(m, "audio %30u/%30u RTP/%4s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
+ (sscanf(m, "audio %30u RTP/%4s %n", &x, protocol, &len) == 2 && len > 0)) {
+ if (x == 0) {
+ ast_log(LOG_WARNING, "Ignoring audio media offer because port number is zero\n");
+ continue;
+ }
+
+ /* Check number of ports offered for stream */
+ if (numberofports > 1) {
+ ast_log(LOG_WARNING, "%d ports offered for audio media, not supported by Asterisk. Will try anyway...\n", numberofports);
+ }
+
+ if (!strcmp(protocol, "SAVP")) {
+ secure_audio = 1;
+ } else if (strcmp(protocol, "AVP")) {
+ ast_log(LOG_WARNING, "Unknown RTP profile in audio offer: %s\n", m);
+ continue;
+ }
+
+ if (p->offered_media[SDP_AUDIO].order_offered) {
+ ast_log(LOG_WARNING, "Rejecting non-primary audio stream: %s\n", m);
return -1;
}
- if (debug)
- ast_verbose("Found RTP audio format %d\n", codec);
- ast_rtp_codecs_payloads_set_m_type(&newaudiortp, NULL, codec);
- }
- /* Search for video media definition */
- } else if ((sscanf(m, "video %30u/%30u RTP/%4s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
- (sscanf(m, "video %30u RTP/%4s %n", &x, protocol, &len) == 2 && len > 0)) {
- if (x == 0) {
- ast_log(LOG_WARNING, "ignoring 'video' media offer because port number is zero\n");
- continue;
- }
- if (!strcmp(protocol, "SAVP")) {
- secure_video = 1;
- } else if (strcmp(protocol, "AVP")) {
- ast_log(LOG_WARNING, "unknown SDP media protocol in offer: %s\n", protocol);
- continue;
+ audio = TRUE;
+ p->offered_media[SDP_AUDIO].order_offered = ++numberofmediastreams;
+ portno = x;
+
+ /* Scan through the RTP payload types specified in a "m=" line: */
+ codecs = m + len;
+ ast_copy_string(p->offered_media[SDP_AUDIO].codecs, codecs, sizeof(p->offered_media[SDP_AUDIO].codecs));
+ for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
+ if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
+ ast_log(LOG_WARNING, "Invalid syntax in RTP audio format list: %s\n", codecs);
+ return -1;
+ }
+ if (debug) {
+ ast_verbose("Found RTP audio format %d\n", codec);
+ }
+
+ ast_rtp_codecs_payloads_set_m_type(&newaudiortp, NULL, codec);
+ }
+ } else {
+ ast_log(LOG_WARNING, "Rejecting audio media offer due to invalid or unsupported syntax: %s\n", m);
+ return -1;
}
- if (p->offered_media[SDP_VIDEO].order_offered) {
- ast_log(LOG_WARNING, "Multiple video streams are not supported\n");
- return -3;
- }
- video = TRUE;
- p->novideo = FALSE;
- p->offered_media[SDP_VIDEO].order_offered = ++numberofmediastreams;
- vportno = x;
-
- /* Scan through the RTP payload types specified in a "m=" line: */
- codecs = m + len;
- ast_copy_string(p->offered_media[SDP_VIDEO].codecs, codecs, sizeof(p->offered_media[SDP_VIDEO].codecs));
- for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
- if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
- ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
+ }
+ /* Check for 'video' media offer */
+ else if (strncmp(m, "video ", 6) == 0) {
+ if ((sscanf(m, "video %30u/%30u RTP/%4s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
+ (sscanf(m, "video %30u RTP/%4s %n", &x, protocol, &len) == 2 && len > 0)) {
+ if (x == 0) {
+ ast_log(LOG_WARNING, "Ignoring video media offer because port number is zero\n");
+ continue;
+ }
+
+ /* Check number of ports offered for stream */
+ if (numberofports > 1) {
+ ast_log(LOG_WARNING, "%d ports offered for video media, not supported by Asterisk. Will try anyway...\n", numberofports);
+ }
+
+ if (!strcmp(protocol, "SAVP")) {
+ secure_video = 1;
+ } else if (strcmp(protocol, "AVP")) {
+ ast_log(LOG_WARNING, "Unknown RTP profile in video offer: %s\n", m);
+ continue;
+ }
+
+ if (p->offered_media[SDP_VIDEO].order_offered) {
+ ast_log(LOG_WARNING, "Rejecting non-primary video stream: %s\n", m);
return -1;
}
- if (debug)
- ast_verbose("Found RTP video format %d\n", codec);
- ast_rtp_codecs_payloads_set_m_type(&newvideortp, NULL, codec);
- }
- /* Search for text media definition */
- } else if ((sscanf(m, "text %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
- (sscanf(m, "text %30u RTP/AVP %n", &x, &len) == 1 && len > 0)) {
- if (x == 0) {
- ast_log(LOG_WARNING, "ignoring 'text' media offer because port number is zero\n");
- continue;
+
+ video = TRUE;
+ p->novideo = FALSE;
+ p->offered_media[SDP_VIDEO].order_offered = ++numberofmediastreams;
+ vportno = x;
+
+ /* Scan through the RTP payload types specified in a "m=" line: */
+ codecs = m + len;
+ ast_copy_string(p->offered_media[SDP_VIDEO].codecs, codecs, sizeof(p->offered_media[SDP_VIDEO].codecs));
+ for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
+ if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
+ ast_log(LOG_WARNING, "Invalid syntax in RTP video format list: %s\n", codecs);
+ return -1;
+ }
+ if (debug) {
+ ast_verbose("Found RTP video format %d\n", codec);
+ }
+ ast_rtp_codecs_payloads_set_m_type(&newvideortp, NULL, codec);
+ }
+ } else {
+ ast_log(LOG_WARNING, "Rejecting video media offer due to invalid or unsupported syntax: %s\n", m);
+ return -1;
}
- if (p->offered_media[SDP_TEXT].order_offered) {
- ast_log(LOG_WARNING, "Multiple text streams are not supported\n");
- return -3;
- }
- text = TRUE;
- p->notext = FALSE;
- p->offered_media[SDP_TEXT].order_offered = ++numberofmediastreams;
- tportno = x;
-
- /* Scan through the RTP payload types specified in a "m=" line: */
- codecs = m + len;
- ast_copy_string(p->offered_media[SDP_TEXT].codecs, codecs, sizeof(p->offered_media[SDP_TEXT].codecs));
- for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
- if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
- ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
+ }
+ /* Check for 'text' media offer */
+ else if (strncmp(m, "text ", 5) == 0) {
+ if ((sscanf(m, "text %30u/%30u RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
+ (sscanf(m, "text %30u RTP/AVP %n", &x, &len) == 1 && len > 0)) {
+ if (x == 0) {
+ ast_log(LOG_WARNING, "Ignoring text media offer because port number is zero\n");
+ continue;
+ }
+
+ /* Check number of ports offered for stream */
+ if (numberofports > 1) {
+ ast_log(LOG_WARNING, "%d ports offered for text media, not supported by Asterisk. Will try anyway...\n", numberofports);
+ }
+
+ if (p->offered_media[SDP_TEXT].order_offered) {
+ ast_log(LOG_WARNING, "Rejecting non-primary text stream: %s\n", m);
return -1;
}
- if (debug)
- ast_verbose("Found RTP text format %d\n", codec);
- ast_rtp_codecs_payloads_set_m_type(&newtextrtp, NULL, codec);
- }
- /* Search for image media definition */
- } else if (((sscanf(m, "image %30u udptl t38%n", &x, &len) == 1 && len > 0) ||
- (sscanf(m, "image %30u UDPTL t38%n", &x, &len) == 1 && len > 0))) {
- if (x == 0) {
- ast_log(LOG_WARNING, "ignoring 'image' media offer because port number is zero\n");
- continue;
- }
- if (initialize_udptl(p)) {
- continue;
- }
- if (p->offered_media[SDP_IMAGE].order_offered) {
- ast_log(LOG_WARNING, "Multiple T.38 streams are not supported\n");
- return -3;
+ text = TRUE;
+ p->notext = FALSE;
+ p->offered_media[SDP_TEXT].order_offered = ++numberofmediastreams;
+ tportno = x;
+
+ /* Scan through the RTP payload types specified in a "m=" line: */
+ codecs = m + len;
+ ast_copy_string(p->offered_media[SDP_TEXT].codecs, codecs, sizeof(p->offered_media[SDP_TEXT].codecs));
+ for (; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
+ if (sscanf(codecs, "%30u%n", &codec, &len) != 1) {
+ ast_log(LOG_WARNING, "Invalid syntax in RTP video format list: %s\n", codecs);
+ return -1;
+ }
+ if (debug) {
+ ast_verbose("Found RTP text format %d\n", codec);
+ }
+ ast_rtp_codecs_payloads_set_m_type(&newtextrtp, NULL, codec);
+ }
+ } else {
+ ast_log(LOG_WARNING, "Rejecting text media offer due to invalid or unsupported syntax: %s\n", m);
+ return -1;
}
- image = TRUE;
- if (debug)
- ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid);
- p->offered_media[SDP_IMAGE].order_offered = ++numberofmediastreams;
- udptlportno = x;
+ }
+ /* Check for 'image' media offer */
+ else if (strncmp(m, "image ", 6) == 0) {
+ if (((sscanf(m, "image %30u udptl t38%n", &x, &len) == 1 && len > 0) ||
+ (sscanf(m, "image %30u UDPTL t38%n", &x, &len) == 1 && len > 0))) {
+ if (x == 0) {
+ ast_log(LOG_WARNING, "Ignoring image media offer because port number is zero\n");
+ continue;
+ }
+
+ if (initialize_udptl(p)) {
+ return -1;
+ }
+
+ if (p->offered_media[SDP_IMAGE].order_offered) {
+ ast_log(LOG_WARNING, "Rejecting non-primary image stream: %s\n", m);
+ return -1;
+ }
+
+ image = TRUE;
+ if (debug) {
+ ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid);
+ }
+
+ p->offered_media[SDP_IMAGE].order_offered = ++numberofmediastreams;
+ udptlportno = x;
- if (p->t38.state != T38_ENABLED) {
- memset(&p->t38.their_parms, 0, sizeof(p->t38.their_parms));
+ if (p->t38.state != T38_ENABLED) {
+ memset(&p->t38.their_parms, 0, sizeof(p->t38.their_parms));
- /* default EC to none, the remote end should
- * respond with the EC they want to use */
- ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE);
+ /* default EC to none, the remote end should
+ * respond with the EC they want to use */
+ ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE);
+ }
+ } else {
+ ast_log(LOG_WARNING, "Rejecting image media offer due to invalid or unsupported syntax: %s\n", m);
+ return -1;
}
} else {
- ast_log(LOG_WARNING, "Unsupported SDP media type in offer: %s\n", m);
+ ast_log(LOG_WARNING, "Unsupported top-level media type in offer: %s\n", m);
continue;
}
- /* Check for number of ports */
- if (numberofports > 1)
- ast_log(LOG_WARNING, "SDP offered %d ports for media, not supported by Asterisk. Will try anyway...\n", numberofports);
-
/* Media stream specific parameters */
while ((type = get_sdp_line(&iterator, next - 1, req, &value)) != '\0') {
int processed = FALSE;
@@ -9116,49 +9179,49 @@
}
ast_debug(3, "Processing media-level (%s) SDP %c=%s... %s\n",
- (audio == TRUE)? "audio" : (video == TRUE)? "video" : "image",
- type, value,
- (processed == TRUE)? "OK." : "UNSUPPORTED.");
+ (audio == TRUE)? "audio" : (video == TRUE)? "video" : (text == TRUE)? "text" : "image",
+ type, value,
+ (processed == TRUE)? "OK." : "UNSUPPORTED OR FAILED.");
}
}
-
/* Sanity checks */
if (!sa && !vsa && !tsa && !isa) {
ast_log(LOG_WARNING, "Insufficient information in SDP (c=)...\n");
return -1;
}
- if (portno == -1 && vportno == -1 && udptlportno == -1 && tportno == -1) {
- /* No acceptable offer found in SDP - we have no ports */
- /* Do not change RTP or VRTP if this is a re-invite */
+ if ((portno == -1) &&
+ (vportno == -1) &&
+ (tportno == -1) &&
+ (udptlportno == -1)) {
ast_log(LOG_WARNING, "Failing due to no acceptable offer found\n");
- return -2;
+ return -1;
}
if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK)))) {
ast_log(LOG_WARNING, "Can't provide secure audio requested in SDP offer\n");
- return -4;
+ return -1;
}
if (!secure_audio && p->srtp) {
- ast_log(LOG_WARNING, "We are requesting SRTP, but they responded without it!\n");
- return -4;
+ ast_log(LOG_WARNING, "We are requesting SRTP for audio, but they responded without it!\n");
+ return -1;
}
if (secure_video && !(p->vsrtp && (ast_test_flag(p->vsrtp, SRTP_CRYPTO_OFFER_OK)))) {
ast_log(LOG_WARNING, "Can't provide secure video requested in SDP offer\n");
- return -4;
+ return -1;
}
if (!p->novideo && !secure_video && p->vsrtp) {
- ast_log(LOG_WARNING, "We are requesting SRTP, but they responded without it!\n");
- return -4;
+ ast_log(LOG_WARNING, "We are requesting SRTP for video, but they responded without it!\n");
+ return -1;
}
if (!(secure_audio || secure_video) && ast_test_flag(&p->flags[1], SIP_PAGE2_USE_SRTP)) {
ast_log(LOG_WARNING, "Matched device setup to use SRTP, but request was not!\n");
- return -4;
+ return -1;
}
if (udptlportno == -1) {
@@ -9202,12 +9265,12 @@
}
if (portno != -1 || vportno != -1 || tportno != -1) {
- /* We are now ready to change the sip session and p->rtp and p->vrtp with the offered codecs, since
+ /* We are now ready to change the sip session and RTP structures with the offered codecs, since
they are acceptable */
p->jointcapability = newjointcapability; /* Our joint codec profile for this call */
- p->peercapability = newpeercapability; /* The other sides capability in latest offer */
+ p->peercapability = newpeercapability; /* The other side's capability in latest offer */
p->jointnoncodeccapability = newnoncodeccapability; /* DTMF capabilities */
-
+
/* respond with single most preferred joint codec, limiting the other side's choice */
if (ast_test_flag(&p->flags[1], SIP_PAGE2_PREFERRED_CODEC)) {
p->jointcapability = ast_codec_choose(&p->prefs, p->jointcapability, 1);
@@ -9300,6 +9363,7 @@
ast_verbose("Peer doesn't provide T.140\n");
}
}
+
/* Setup image address and port */
if (p->udptl) {
if (udptlportno > 0) {
@@ -9380,7 +9444,7 @@
ast_set_read_format(p->owner, p->owner->readformat);
ast_set_write_format(p->owner, p->owner->writeformat);
}
-
+
if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && (!ast_sockaddr_isnull(sa) || !ast_sockaddr_isnull(vsa) || !ast_sockaddr_isnull(tsa) || !ast_sockaddr_isnull(isa)) && (!sendonly || sendonly == -1)) {
ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
/* Activate a re-invite */
@@ -9397,7 +9461,7 @@
ast_queue_frame(p->owner, &ast_null_frame);
change_hold_state(p, req, TRUE, sendonly);
}
-
+
return 0;
}
@@ -10369,10 +10433,9 @@
* final response. For a CANCEL or ACK, we have to send to the same destination
* as the original INVITE.
*/
- if (sipmethod == SIP_CANCEL ||
- (sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED))) {
- set_destination(p, ast_strdupa(p->uri));
- } else if (p->route) {
+ if (p->route &&
+ !(sipmethod == SIP_CANCEL ||
+ (sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED)))) {
set_destination(p, p->route->hop);
add_route(req, is_strict ? p->route->next : p->route);
}
@@ -11860,7 +11923,7 @@
initialize_initreq(p, &req);
p->lastinvite = p->ocseq;
ast_set_flag(&p->flags[0], SIP_OUTGOING); /* Change direction of this dialog */
-
+ p->ongoing_reinvite = 1;
return send_request(p, &req, XMIT_CRITICAL, p->ocseq);
}
@@ -12629,6 +12692,16 @@
if ((state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
const char *local_display = exten;
char *local_target = ast_strdupa(mto);
+ const char *remote_display = exten;
+ /* It may seem odd to base the remote_target on the To header here,
+ * but testing by reporters on issue ASTERISK-16735 found that basing
+ * on the From header would cause ringing state hints to not work
+ * properly on certain SNOM devices. If you are using notifycid properly
+ * (i.e. in the same extension and context as the dialed call) then this
+ * should not be an issue since the data will be overwritten shortly
+ * with channel caller ID
+ */
+ char *remote_target = ast_strdupa(mto);
/* There are some limitations to how this works. The primary one is that the
callee must be dialing the same extension that is being monitored. Simply dialing
@@ -12638,16 +12711,28 @@
if ((caller = ast_channel_callback(find_calling_channel, NULL, p, 0))) {
char *cid_num;
+ char *connected_num;
int need;
ast_channel_lock(caller);
cid_num = S_COR(caller->caller.id.number.valid,
caller->caller.id.number.str, "");
need = strlen(cid_num) + strlen(p->fromdomain) + sizeof("sip:@");
- local_target = alloca(need);
- snprintf(local_target, need, "sip:%s@%s", cid_num, p->fromdomain);
- local_display = ast_strdupa(S_COR(caller->caller.id.name.valid,
+ remote_target = alloca(need);
+ snprintf(remote_target, need, "sip:%s@%s", cid_num, p->fromdomain);
+
+ remote_display = ast_strdupa(S_COR(caller->caller.id.name.valid,
caller->caller.id.name.str, ""));
+
+ connected_num = S_COR(caller->connected.id.number.valid,
+ caller->connected.id.number.str, "");
+ need = strlen(connected_num) + strlen(p->fromdomain) + sizeof("sip:@");
+ local_target = alloca(need);
+ snprintf(local_target, need, "sip:%s@%s", connected_num, p->fromdomain);
+
+ local_display = ast_strdupa(S_COR(caller->connected.id.name.valid,
+ caller->connected.id.name.str, ""));
+
ast_channel_unlock(caller);
caller = ast_channel_unref(caller);
}
@@ -12669,10 +12754,10 @@
"<target uri=\"%s\"/>\n"
"</remote>\n"
"<local>\n"
- "<identity>%s</identity>\n"
+ "<identity display=\"%s\">%s</identity>\n"
"<target uri=\"%s\"/>\n"
"</local>\n",
- local_display, local_target, local_target, mto, mto);
+ remote_display, remote_target, remote_target, local_display, local_target, local_target);
} else {
ast_str_append(tmp, 0, "<dialog id=\"%s\" direction=\"recipient\">\n", exten);
}
@@ -14712,6 +14797,20 @@
ast_sockaddr_split_hostport(*hostport, hostport, &dont_care, PARSE_PORT_IGNORE);
}
+/*! \internal \brief Helper function to update a peer's lastmsgssent value
+ */
+static void update_peer_lastmsgssent(struct sip_peer *peer, int value, int locked)
+{
+ if (!locked) {
+ ao2_lock(peer);
+ }
+ peer->lastmsgssent = value;
+ if (!locked) {
+ ao2_unlock(peer);
+ }
+}
+
+
/*! \brief Verify registration of user
- Registration is done in several steps, first a REGISTER without auth
to get a challenge (nonce) then a second one with auth
@@ -14725,6 +14824,7 @@
char tmp[256];
char *c, *name, *unused_password, *domain;
char *uri2 = ast_strdupa(uri);
+ int send_mwi = 0;
terminate_uri(uri2);
@@ -14828,19 +14928,16 @@
case PARSE_REGISTER_DENIED:
ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
transmit_response_with_date(p, "603 Denied", req);
- peer->lastmsgssent = -1;
res = 0;
break;
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
transmit_response_with_date(p, "400 Bad Request", req);
- peer->lastmsgssent = -1;
res = 0;
break;
case PARSE_REGISTER_QUERY:
ast_string_field_set(p, fullcontact, peer->fullcontact);
transmit_response_with_date(p, "200 OK", req);
- peer->lastmsgssent = -1;
res = 0;
break;
case PARSE_REGISTER_UPDATE:
@@ -14848,8 +14945,7 @@
update_peer(peer, p->expiry);
/* Say OK and ask subsystem to retransmit msg counter */
transmit_response_with_date(p, "200 OK", req);
- if (!ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY))
- peer->lastmsgssent = -1;
+ send_mwi = 1;
res = 0;
break;
}
@@ -14874,19 +14970,17 @@
case PARSE_REGISTER_DENIED:
ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
transmit_response_with_date(p, "403 Forbidden (ACL)", req);
- peer->lastmsgssent = -1;
res = 0;
break;
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
transmit_response_with_date(p, "400 Bad Request", req);
- peer->lastmsgssent = -1;
res = 0;
break;
case PARSE_REGISTER_QUERY:
ast_string_field_set(p, fullcontact, peer->fullcontact);
transmit_response_with_date(p, "200 OK", req);
- peer->lastmsgssent = -1;
+ send_mwi = 1;
res = 0;
break;
case PARSE_REGISTER_UPDATE:
@@ -14894,7 +14988,7 @@
/* Say OK and ask subsystem to retransmit msg counter */
transmit_response_with_date(p, "200 OK", req);
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\n", peer->name, ast_sockaddr_stringify(addr));
- peer->lastmsgssent = -1;
+ send_mwi = 1;
res = 0;
break;
}
@@ -14902,6 +14996,11 @@
}
}
if (!res) {
+ if (send_mwi) {
+ sip_send_mwi_to_peer(peer, 0);
+ } else {
+ update_peer_lastmsgssent(peer, -1, 0);
+ }
ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
}
if (res < 0) {
@@ -15241,7 +15340,7 @@
}
/* Remove enclosing double-quotes */
if (*reason_param == '"')
- ast_strip_quoted(reason_param, "\"", "\"");
+ reason_param = ast_strip_quoted(reason_param, "\"", "\"");
if (!ast_strlen_zero(reason_param)) {
sip_set_redirstr(p, reason_param);
if (p->owner) {
@@ -15266,7 +15365,9 @@
char *end_quote;
rname = tmp + 1;
end_quote = strchr(rname, '\"');
- *end_quote = '\0';
+ if (end_quote) {
+ *end_quote = '\0';
+ }
}
if (number) {
@@ -15889,7 +15990,9 @@
p->sa = p->recv;
}
- ast_sockaddr_resolve_first(&tmp, c, 0);
+ if (ast_sockaddr_resolve_first(&tmp, c, 0)) {
+ ast_log(LOG_WARNING, "Could not resolve socket address for '%s'\n", c);
+ }
port = ast_sockaddr_port(&tmp);
ast_sockaddr_set_port(&p->sa,
port != 0 ? port : STANDARD_SIP_PORT);
@@ -15993,6 +16096,8 @@
else
p->timer_b = 64 * p->timer_t1;
+ p->allowtransfer = peer->allowtransfer;
+
if (ast_test_flag(&peer->flags[0], SIP_INSECURE_INVITE)) {
/* Pretend there is no required authentication */
ast_string_field_set(p, peersecret, NULL);
@@ -16198,6 +16303,7 @@
/* Finally, apply the guest policy */
if (sip_cfg.allowguest) {
+ /* Ignore check_return warning from Coverity for get_rpid below. */
get_rpid(p, req);
p->rtptimeout = global_rtptimeout;
p->rtpholdtimeout = global_rtpholdtimeout;
@@ -17948,7 +18054,10 @@
return 0; /* don't care, we scan all channels */
}
- ast_rtp_instance_get_stats(cur->rtp, &stats, AST_RTP_INSTANCE_STAT_ALL);
+ if (ast_rtp_instance_get_stats(cur->rtp, &stats, AST_RTP_INSTANCE_STAT_ALL)) {
+ ast_log(LOG_WARNING, "Could not get RTP stats.\n");
+ return 0;
+ }
if (c && c->cdr && !ast_tvzero(c->cdr->start)) {
duration = (int)(ast_tvdiff_ms(ast_tvnow(), c->cdr->start) / 1000);
@@ -19762,8 +19871,11 @@
static void check_pendings(struct sip_pvt *p)
{
if (ast_test_flag(&p->flags[0], SIP_PENDINGBYE)) {
- /* if we can't BYE, then this is really a pending CANCEL */
- if (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA) {
+ if (p->reinviteid > -1) {
+ /* Outstanding p->reinviteid timeout, so wait... */
+ return;
+ } else if (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA) {
+ /* if we can't BYE, then this is really a pending CANCEL */
p->invitestate = INV_CANCELLED;
transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);
/* If the cancel occurred on an initial invite, cancel the pending BYE */
@@ -19774,8 +19886,9 @@
INVITE, but do set an autodestruct just in case we never get it. */
} else {
/* We have a pending outbound invite, don't send something
- new in-transaction */
- if (p->pendinginvite)
+ * new in-transaction, unless it is a pending reinvite, then
+ * by the time we are called here, we should probably just hang up. */
+ if (p->pendinginvite && !p->ongoing_reinvite)
return;
if (p->owner) {
@@ -19980,9 +20093,17 @@
if (resp >= 300 && (p->invitestate == INV_CALLING || p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA ))
p->invitestate = INV_COMPLETED;
+ if ((resp >= 200 && reinvite)) {
+ p->ongoing_reinvite = 0;
+ if (p->reinviteid > -1) {
+ AST_SCHED_DEL_UNREF(sched, p->reinviteid, dialog_unref(p, "unref dialog for reinvite timeout because of a final response"));
+ }
+ }
+
/* Final response, clear out pending invite */
- if ((resp == 200 || resp >= 300) && p->pendinginvite && seqno == p->pendinginvite)
+ if ((resp == 200 || resp >= 300) && p->pendinginvite && seqno == p->pendinginvite) {
p->pendinginvite = 0;
+ }
/* If this is a response to our initial INVITE, we need to set what we can use
* for this peer.
@@ -20285,7 +20406,7 @@
ast_log(LOG_WARNING, "Received response: \"Forbidden\" from '%s'\n", get_header(&p->initreq, "From"));
if (!req->ignore && p->owner) {
ast_set_hangupsource(p->owner, p->owner->name, 0);
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
break;
@@ -20293,7 +20414,7 @@
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner && !req->ignore) {
ast_set_hangupsource(p->owner, p->owner->name, 0);
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
break;
@@ -20303,7 +20424,7 @@
ast_log(LOG_WARNING, "Re-invite to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid);
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner) {
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
break;
@@ -20318,7 +20439,7 @@
append_history(p, "Identity", "SIP identity is required. Not supported by Asterisk.");
ast_log(LOG_WARNING, "SIP identity required by proxy. SIP dialog '%s'. Giving up.\n", p->callid);
if (p->owner && !req->ignore) {
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
break;
@@ -20351,7 +20472,7 @@
} else {
/* We can't set up this call, so give up */
if (p->owner && !req->ignore) {
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
}
break;
@@ -20359,7 +20480,7 @@
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner && !req->ignore) {
if (p->owner->_state != AST_STATE_UP) {
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
} else {
/* This is a re-invite that failed. */
/* Reset the flag after a while
@@ -20383,7 +20504,7 @@
case 501: /* Not implemented */
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner) {
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_CONGESTION);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
}
break;
}
@@ -21247,7 +21368,7 @@
default:
/* Send hangup */
if (owner && sipmethod != SIP_BYE)
- ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR);
+ ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
break;
}
/* ACK on invite */
@@ -22327,9 +22448,7 @@
}
}
transmit_response_reliable(p, "491 Request Pending", req);
- p->pendinginvite = seqno;
check_via(p, req);
- copy_request(&p->initreq, req);
ast_debug(1, "Got INVITE on call where we already have pending INVITE, deferring that - %s\n", p->callid);
/* Don't destroy dialog here */
res = 0;
@@ -22349,7 +22468,6 @@
if (p->owner) {
ast_debug(3, "INVITE w Replaces on existing call? Refusing action. [%s]\n", p->callid);
transmit_response_reliable(p, "400 Bad request", req); /* The best way to not not accept the transfer */
- p->pendinginvite = seqno;
check_via(p, req);
copy_request(&p->initreq, req);
/* Do not destroy existing call */
@@ -22368,7 +22486,6 @@
append_history(p, "Xfer", "INVITE/Replace Failed. Out of memory.");
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
p->invitestate = INV_COMPLETED;
- p->pendinginvite = seqno;
check_via(p, req);
copy_request(&p->initreq, req);
res = -1;
@@ -22473,7 +22590,6 @@
}
refer_locked = 0;
p->invitestate = INV_COMPLETED;
- p->pendinginvite = seqno;
check_via(p, req);
copy_request(&p->initreq, req);
res = -1;
@@ -24211,6 +24327,7 @@
* document earlier. So there's no need to enclose this operation in an if statement.
*/
tuple_children = ast_xml_node_get_children(tuple_node);
+ /* coverity[null_returns: FALSE] */
status_node = ast_xml_find_element(tuple_children, "status", NULL, NULL);
if (!(status_children = ast_xml_node_get_children(status_node))) {
@@ -24542,7 +24659,8 @@
struct sip_peer *authpeer = NULL;
const char *eventheader = get_header(req, "Event"); /* Get Event package name */
int resubscribe = (p->subscribed != NONE) && !req->ignore;
- char *temp, *event;
+ char *event_end;
+ ptrdiff_t event_len = 0;
if (p->initreq.headers) {
/* We already have a dialog */
@@ -24604,13 +24722,10 @@
return 0;
}
- if ( (strchr(eventheader, ';'))) {
- event = ast_strdupa(eventheader); /* Since eventheader is a const, we can't change it */
- temp = strchr(event, ';');
- *temp = '\0'; /* Remove any options for now */
- /* We might need to use them later :-) */
- } else
- event = (char *) eventheader; /* XXX is this legal ? */
+ event_end = strchr(eventheader, ';');
+ if (event_end) {
+ event_len = event_end - eventheader;
+ }
/* Handle authentication if we're new and not a retransmission. We can't just
* use if !req->ignore, because then we'll end up sending
@@ -24649,7 +24764,7 @@
return 0;
}
- if (strcmp(event, "message-summary") && strcmp(event, "call-completion")) {
+ if (strncmp(eventheader, "message-summary", MAX(event_len, 15)) && strncmp(eventheader, "call-completion", MAX(event_len, 15))) {
/* Get destination right away */
gotdest = get_destination(p, NULL, NULL);
}
@@ -24675,7 +24790,7 @@
if (ast_strlen_zero(p->tag))
make_our_tag(p->tag, sizeof(p->tag));
- if (!strcmp(event, "presence") || !strcmp(event, "dialog")) { /* Presence, RFC 3842 */
+ if (!strncmp(eventheader, "presence", MAX(event_len, 8)) || !strncmp(eventheader, "dialog", MAX(event_len, 6))) { /* Presence, RFC 3842 */
unsigned int pidf_xml;
const char *accept;
int start = 0;
@@ -24753,7 +24868,7 @@
} else {
p->subscribed = subscribed;
}
- } else if (!strcmp(event, "message-summary")) {
+ } else if (!strncmp(eventheader, "message-summary", MAX(event_len, 15))) {
int start = 0;
int found_supported = 0;
const char *acceptheader;
@@ -24816,11 +24931,11 @@
p->relatedpeer = ref_peer(authpeer, "setting dialog's relatedpeer pointer");
}
/* Do not release authpeer here */
- } else if (!strcmp(event, "call-completion")) {
+ } else if (!strncmp(eventheader, "call-completion", MAX(event_len, 15))) {
handle_cc_subscribe(p, req);
} else { /* At this point, Asterisk does not understand the specified event */
transmit_response(p, "489 Bad Event", req);
- ast_debug(2, "Received SIP subscribe for unknown event package: %s\n", event);
+ ast_debug(2, "Received SIP subscribe for unknown event package: %s\n", eventheader);
pvt_set_needdestroy(p, "unknown event package");
if (authpeer) {
unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 5)");
@@ -24841,9 +24956,10 @@
}
}
- if (!req->ignore && p)
+ if (!req->ignore) {
p->lastinvite = seqno;
- if (p && !p->needdestroy) {
+ }
+ if (!p->needdestroy) {
p->expiry = atoi(get_header(req, "Expires"));
/* check if the requested expiry-time is within the approved limits from sip.conf */
@@ -25164,15 +25280,24 @@
if (!p->initreq.headers && req->has_to_tag) {
/* If this is a first request and it got a to-tag, it is not for us */
if (!req->ignore && req->method == SIP_INVITE) {
+ /* We will be subversive here. By blanking out the to-tag of the request,
+ * it will cause us to attach our own generated to-tag instead. This way,
+ * when we receive an ACK, the ACK will contain the to-tag we generated,
+ * resulting in a proper to-tag match.
+ */
+ char *to_header = (char *) get_header(req, "To");
+ char *tag = strstr(to_header, ";tag=");
+ *tag = '\0';
+ p->pendinginvite = p->icseq;
transmit_response_reliable(p, "481 Call/Transaction Does Not Exist", req);
/* Will cease to exist after ACK */
+ return res;
} else if (req->method != SIP_ACK) {
transmit_response(p, "481 Call/Transaction Does Not Exist", req);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
- } else {
- ast_debug(1, "Got ACK for unknown dialog... strange.\n");
+ return res;
}
- return res;
+ /* Otherwise, this is an ACK. It will always have a to-tag */
}
}
@@ -25567,7 +25692,7 @@
ao2_t_ref(ca, -1, "failed to create client, getting rid of client tcptls_session arguments");
}
if (s->tcptls_session) {
- ast_tcptls_close_session_file(tcptls_session);
+ ast_tcptls_close_session_file(s->tcptls_session);
s->fd = -1;
ao2_ref(s->tcptls_session, -1);
s->tcptls_session = NULL;
@@ -25623,12 +25748,14 @@
}
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
+ update_peer_lastmsgssent(peer, -1, 1);
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)) {
+ update_peer_lastmsgssent(peer, -1, 1);
ao2_unlock(peer);
return 0;
}
@@ -25639,6 +25766,11 @@
struct ast_str *mailbox_str = ast_str_alloca(512);
peer_mailboxes_to_str(&mailbox_str, peer);
ao2_unlock(peer);
+ /* If there is no mailbox do nothing */
+ if (ast_strlen_zero(mailbox_str->str)) {
+ update_peer_lastmsgssent(peer, -1, 0);
+ return 0;
+ }
ast_app_inboxcount(mailbox_str->str, &newmsgs, &oldmsgs);
ao2_lock(peer);
}
@@ -25651,6 +25783,7 @@
ao2_unlock(peer);
/* Build temporary dialog for this message */
if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY, NULL))) {
+ update_peer_lastmsgssent(peer, -1, 0);
return -1;
}
@@ -25663,7 +25796,7 @@
/* Maybe they're not registered, etc. */
dialog_unlink_all(p);
dialog_unref(p, "unref dialog p just created via sip_alloc");
- /* sip_destroy(p); */
+ update_peer_lastmsgssent(peer, -1, 0);
return 0;
}
/* Recalculate our side, and recalculate Call ID */
@@ -25696,6 +25829,8 @@
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.");
+ update_peer_lastmsgssent(peer, ((newmsgs > 0x7fff ? 0x7fff0000 : (newmsgs << 16)) | (oldmsgs > 0xffff ? 0xffff : oldmsgs)), 0);
+
return 0;
}
@@ -26179,8 +26314,12 @@
*/
enum st_mode st_get_mode(struct sip_pvt *p, int no_cached)
{
- if (!p->stimer)
+ if (!p->stimer) {
sip_st_alloc(p);
+ if (!p->stimer) {
+ return SESSION_TIMER_MODE_INVALID;
+ }
+ }
if (!no_cached && p->stimer->st_cached_mode != SESSION_TIMER_MODE_INVALID)
return p->stimer->st_cached_mode;
@@ -27390,32 +27529,42 @@
} else if (!strcasecmp(v->name, "fromuser")) {
ast_string_field_set(peer, fromuser, v->value);
} else if (!strcasecmp(v->name, "outboundproxy")) {
- char *tok, *proxyname;
+ char *host, *proxyname, *sep;
if (ast_strlen_zero(v->value)) {
- ast_log(LOG_WARNING, "no value given for outbound proxy on line %d of sip.conf.", v->lineno);
+ ast_log(LOG_WARNING, "no value given for outbound proxy on line %d of sip.conf\n", v->lineno);
continue;
}
- peer->outboundproxy =
- ao2_alloc(sizeof(*peer->outboundproxy), NULL);
-
- tok = ast_skip_blanks(strtok(ast_strdupa(v->value), ","));
-
- sip_parse_host(tok, v->lineno, &proxyname,
- &peer->outboundproxy->port,
- &peer->outboundproxy->transport);
+ if (!peer->outboundproxy) {
+ peer->outboundproxy = ao2_alloc(sizeof(*peer->outboundproxy), NULL);
+ if (!peer->outboundproxy) {
+ ast_log(LOG_WARNING, "Unable to allocate config storage for outboundproxy\n");
+ continue;
+ }
+ }
- tok = ast_skip_blanks(strtok(ast_strdupa(v->value), ","));
+ host = ast_strdupa(v->value);
+ if (!host) {
+ ast_log(LOG_WARNING, "Unable to allocate stack space for parsing outboundproxy\n");
+ continue;
+ }
- if ((tok = strtok(NULL, ","))) {
- peer->outboundproxy->force = !strncasecmp(ast_skip_blanks(tok), "force", 5);
+ host = ast_skip_blanks(host);
+ sep = strchr(host, ',');
+ if (sep) {
+ *sep++ = '\0';
+ peer->outboundproxy->force = !strncasecmp(ast_skip_blanks(sep), "force", 5);
} else {
peer->outboundproxy->force = FALSE;
}
+ sip_parse_host(host, v->lineno, &proxyname,
+ &peer->outboundproxy->port,
+ &peer->outboundproxy->transport);
+
if (ast_strlen_zero(proxyname)) {
- ast_log(LOG_WARNING, "you must specify a name for the outboundproxy on line %d of sip.conf.", v->lineno);
+ ast_log(LOG_WARNING, "you must specify a name for the outboundproxy on line %d of sip.conf\n", v->lineno);
sip_cfg.outboundproxy.name[0] = '\0';
continue;
}
@@ -27969,6 +28118,11 @@
ast_config_destroy(ucfg);
return 1;
}
+ if (!cfg) {
+ /* should have been able to reload here */
+ ast_log(LOG_NOTICE, "Unable to load config %s\n", config);
+ return -1;
+ }
} else if (cfg == CONFIG_STATUS_FILEINVALID) {
ast_log(LOG_ERROR, "Contents of %s are invalid and cannot be parsed\n", config);
return 1;
@@ -28361,27 +28515,34 @@
default_fromdomainport = STANDARD_SIP_PORT;
}
} else if (!strcasecmp(v->name, "outboundproxy")) {
- char *tok, *proxyname;
+ char *host, *proxyname, *sep;
if (ast_strlen_zero(v->value)) {
- ast_log(LOG_WARNING, "no value given for outbound proxy on line %d of sip.conf.", v->lineno);
+ ast_log(LOG_WARNING, "no value given for outbound proxy on line %d of sip.conf\n", v->lineno);
continue;
}
- tok = ast_skip_blanks(strtok(ast_strdupa(v->value), ","));
-
- sip_parse_host(tok, v->lineno, &proxyname,
- &sip_cfg.outboundproxy.port,
- &sip_cfg.outboundproxy.transport);
+ host = ast_strdupa(v->value);
+ if (!host) {
+ ast_log(LOG_WARNING, "Unable to allocate stack space for parsing outboundproxy\n");
+ continue;
+ }
- if ((tok = strtok(NULL, ","))) {
- sip_cfg.outboundproxy.force = !strncasecmp(ast_skip_blanks(tok), "force", 5);
+ host = ast_skip_blanks(host);
+ sep = strchr(host, ',');
+ if (sep) {
+ *sep++ = '\0';
+ sip_cfg.outboundproxy.force = !strncasecmp(ast_skip_blanks(sep), "force", 5);
} else {
sip_cfg.outboundproxy.force = FALSE;
}
+ sip_parse_host(host, v->lineno, &proxyname,
+ &sip_cfg.outboundproxy.port,
+ &sip_cfg.outboundproxy.transport);
+
if (ast_strlen_zero(proxyname)) {
- ast_log(LOG_WARNING, "you must specify a name for the outboundproxy on line %d of sip.conf.", v->lineno);
+ ast_log(LOG_WARNING, "you must specify a name for the outboundproxy on line %d of sip.conf\n", v->lineno);
sip_cfg.outboundproxy.name[0] = '\0';
continue;
}
@@ -28998,15 +29159,21 @@
return 0;
}
-static int apply_directmedia_ha(struct sip_pvt *p, const char *op)
+static int apply_directmedia_ha(struct sip_pvt *p1, struct sip_pvt *p2, const char *op)
{
struct ast_sockaddr us = { { 0, }, }, them = { { 0, }, };
int res = AST_SENSE_ALLOW;
- ast_rtp_instance_get_remote_address(p->rtp, &them);
- ast_rtp_instance_get_local_address(p->rtp, &us);
+ ast_rtp_instance_get_remote_address(p1->rtp, &them);
+ ast_rtp_instance_get_local_address(p1->rtp, &us);
- if ((res = ast_apply_ha(p->directmediaha, &them)) == AST_SENSE_DENY) {
+ /* If p2 is a guest call, there will be no peer. If there is no peer, there
+ * is no directmediaha, so go ahead and allow it */
+ if (!p2->relatedpeer) {
+ return res;
+ }
+
+ if ((res = ast_apply_ha(p2->relatedpeer->directmediaha, &them)) == AST_SENSE_DENY) {
const char *us_addr = ast_strdupa(ast_sockaddr_stringify(&us));
const char *them_addr = ast_strdupa(ast_sockaddr_stringify(&them));
@@ -29020,19 +29187,35 @@
static struct ast_udptl *sip_get_udptl_peer(struct ast_channel *chan)
{
struct sip_pvt *p;
+ struct ast_channel *opp_chan;
+ struct sip_pvt *opp;
struct ast_udptl *udptl = NULL;
-
+
p = chan->tech_pvt;
if (!p) {
return NULL;
}
-
+
+ if (!(opp_chan = ast_bridged_channel(chan))) {
+ return NULL;
+ } else if ((opp_chan->tech != &sip_tech) || (!(opp = opp_chan->tech_pvt))) {
+ return NULL;
+ }
+
sip_pvt_lock(p);
+ while (sip_pvt_trylock(opp)) {
+ sip_pvt_unlock(p);
+ usleep(1);
+ sip_pvt_lock(p);
+ }
+
if (p->udptl && ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
- if (apply_directmedia_ha(p, "UDPTL T.38 data")) {
+ if (apply_directmedia_ha(p, opp, "UDPTL T.38 data")) {
udptl = p->udptl;
}
}
+
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return udptl;
}
@@ -29083,14 +29266,29 @@
static enum ast_rtp_glue_result sip_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct sip_pvt *p = NULL;
+ struct ast_channel *opp_chan;
+ struct sip_pvt *opp = NULL;
enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_LOCAL;
if (!(p = chan->tech_pvt)) {
return AST_RTP_GLUE_RESULT_FORBID;
}
+ if (!(opp_chan = ast_bridged_channel(chan))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ } else if ((opp_chan->tech != &sip_tech) || (!(opp = opp_chan->tech_pvt))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ }
+
sip_pvt_lock(p);
+ while (sip_pvt_trylock(opp)) {
+ sip_pvt_unlock(p);
+ usleep(1);
+ sip_pvt_lock(p);
+ }
+
if (!(p->rtp)) {
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return AST_RTP_GLUE_RESULT_FORBID;
}
@@ -29100,7 +29298,7 @@
if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
- if (!apply_directmedia_ha(p, "audio")) {
+ if (!apply_directmedia_ha(p, opp, "audio")) {
res = AST_RTP_GLUE_RESULT_FORBID;
}
} else if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) {
@@ -29109,6 +29307,8 @@
res = AST_RTP_GLUE_RESULT_FORBID;
}
+ sip_pvt_unlock(opp);
+
if (p->srtp) {
res = AST_RTP_GLUE_RESULT_FORBID;
}
@@ -29121,14 +29321,29 @@
static enum ast_rtp_glue_result sip_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct sip_pvt *p = NULL;
+ struct ast_channel *opp_chan;
+ struct sip_pvt *opp = NULL;
enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_FORBID;
if (!(p = chan->tech_pvt)) {
return AST_RTP_GLUE_RESULT_FORBID;
}
+ if (!(opp_chan = ast_bridged_channel(chan))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ } else if ((opp_chan->tech != &sip_tech) || (!(opp = opp_chan->tech_pvt))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ }
+
sip_pvt_lock(p);
+ while (sip_pvt_trylock(opp)) {
+ sip_pvt_unlock(p);
+ usleep(1);
+ sip_pvt_lock(p);
+ }
+
if (!(p->vrtp)) {
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return AST_RTP_GLUE_RESULT_FORBID;
}
@@ -29138,11 +29353,12 @@
if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
- if (!apply_directmedia_ha(p, "video")) {
+ if (!apply_directmedia_ha(p, opp, "video")) {
res = AST_RTP_GLUE_RESULT_FORBID;
}
}
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return res;
@@ -29151,14 +29367,29 @@
static enum ast_rtp_glue_result sip_get_trtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct sip_pvt *p = NULL;
+ struct ast_channel *opp_chan;
+ struct sip_pvt *opp = NULL;
enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_FORBID;
if (!(p = chan->tech_pvt)) {
return AST_RTP_GLUE_RESULT_FORBID;
}
+ if (!(opp_chan = ast_bridged_channel(chan))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ } else if ((opp_chan->tech != &sip_tech) || (!(opp = opp_chan->tech_pvt))) {
+ return AST_RTP_GLUE_RESULT_FORBID;
+ }
+
sip_pvt_lock(p);
+ while (sip_pvt_trylock(opp)) {
+ sip_pvt_unlock(p);
+ usleep(1);
+ sip_pvt_lock(p);
+ }
+
if (!(p->trtp)) {
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return AST_RTP_GLUE_RESULT_FORBID;
}
@@ -29168,11 +29399,12 @@
if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
- if (!apply_directmedia_ha(p, "text")) {
+ if (!apply_directmedia_ha(p, opp, "text")) {
res = AST_RTP_GLUE_RESULT_FORBID;
}
}
+ sip_pvt_unlock(opp);
sip_pvt_unlock(p);
return res;
@@ -30489,6 +30721,7 @@
if (sip_tls_desc.master) {
ast_tcptls_server_stop(&sip_tls_desc);
}
+ ast_ssl_teardown(sip_tls_desc.tls_cfg);
/* Kill all existing TCP/TLS threads */
i = ao2_iterator_init(threadt, 0);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/chan_skinny.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367965 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367843 $")
#include <sys/socket.h>
#include <netinet/in.h>
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/iax2-parser.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 243943 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include <sys/socket.h>
#include <netinet/in.h>
@@ -1192,7 +1192,7 @@
AST_LIST_TRAVERSE_SAFE_END;
}
if (!fr) {
- if (iax_frames->size >= FRAME_CACHE_MAX_SIZE && smallest) {
+ if (iax_frames && iax_frames->size >= FRAME_CACHE_MAX_SIZE && smallest) {
/* Make useless cache into something more useful */
AST_LIST_REMOVE(&iax_frames->list, smallest, list);
if (!(fr = ast_realloc(smallest, sizeof(*fr) + datalen))) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/iax2-provision.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 317474 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366094 $")
#include <netdb.h>
#include <netinet/in.h>
@@ -258,7 +258,11 @@
memset(&ied, 0, sizeof(ied));
ast_mutex_lock(&provlock);
- ast_db_get("iax/provisioning/cache", template, tmp, sizeof(tmp));
+ if (!(ast_db_get("iax/provisioning/cache", template, tmp, sizeof(tmp)))) {
+ ast_log(LOG_ERROR, "ast_db_get failed to retrieve iax/provisioning/cache\n");
+ ast_mutex_unlock(&provlock);
+ return -1;
+ }
if (sscanf(tmp, "v%30x", version) != 1) {
if (strcmp(tmp, "u")) {
ret = iax_provision_build(&ied, version, template, force);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sig_analog.c
^
|
@@ -535,23 +535,19 @@
}
}
-#if 0
static void analog_unlock_private(struct analog_pvt *p)
{
if (p->calls->unlock_private) {
p->calls->unlock_private(p->chan_pvt);
}
}
-#endif
-#if 0
static void analog_lock_private(struct analog_pvt *p)
{
if (p->calls->lock_private) {
p->calls->lock_private(p->chan_pvt);
}
}
-#endif
/*!
* \internal
@@ -2741,7 +2737,10 @@
analog_train_echocanceller(p);
ast_copy_string(p->dop.dialstr, p->echorest, sizeof(p->dop.dialstr));
p->dop.op = ANALOG_DIAL_OP_REPLACE;
- analog_dial_digits(p, ANALOG_SUB_REAL, &p->dop);
+ if (analog_dial_digits(p, ANALOG_SUB_REAL, &p->dop)) {
+ int dial_err = errno;
+ ast_log(LOG_WARNING, "Dialing failed on channel %d: %s\n", p->channel, strerror(dial_err));
+ }
p->echobreak = 0;
} else {
analog_set_dialing(p, 0);
@@ -2787,6 +2786,7 @@
case ANALOG_EVENT_ALARM:
analog_set_alarm(p, 1);
analog_get_and_handle_alarms(p);
+ /* Intentionally fall through to analog_set_echocanceller() call */
case ANALOG_EVENT_ONHOOK:
switch (p->sig) {
case ANALOG_SIG_FXOLS:
@@ -3199,8 +3199,18 @@
ast_log(LOG_WARNING, "Unable to allocate three-way subchannel\n");
goto winkflashdone;
}
- /* Make new channel */
+
+ /*
+ * Make new channel
+ *
+ * We cannot hold the p or ast locks while creating a new
+ * channel.
+ */
+ analog_unlock_private(p);
+ ast_channel_unlock(ast);
chan = analog_new_ast_channel(p, AST_STATE_RESERVED, 0, ANALOG_SUB_THREEWAY, NULL);
+ ast_channel_lock(ast);
+ analog_lock_private(p);
if (!chan) {
ast_log(LOG_WARNING,
"Cannot allocate new call structure on channel %d\n",
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sig_pri.c
^
|
@@ -115,13 +115,6 @@
#define DCHAN_AVAILABLE (DCHAN_NOTINALARM | DCHAN_UP)
-#define PRI_DEADLOCK_AVOIDANCE(p) \
- do { \
- sig_pri_unlock_private(p); \
- usleep(1); \
- sig_pri_lock_private(p); \
- } while (0)
-
static int pri_active_dchan_index(struct sig_pri_span *pri);
static const char *sig_pri_call_level2str(enum sig_pri_call_level level)
@@ -345,16 +338,17 @@
static inline int pri_grab(struct sig_pri_chan *p, struct sig_pri_span *pri)
{
- int res;
/* Grab the lock first */
- do {
- res = ast_mutex_trylock(&pri->lock);
- if (res) {
- PRI_DEADLOCK_AVOIDANCE(p);
- }
- } while (res);
+ while (ast_mutex_trylock(&pri->lock)) {
+ /* Avoid deadlock */
+ sig_pri_unlock_private(p);
+ sched_yield();
+ sig_pri_lock_private(p);
+ }
/* Then break the poll */
- pthread_kill(pri->master, SIGURG);
+ if (pri->master != AST_PTHREADT_NULL) {
+ pthread_kill(pri->master, SIGURG);
+ }
return 0;
}
@@ -1193,10 +1187,11 @@
/* We got the lock */
break;
}
- /* We must unlock the PRI to avoid the possibility of a deadlock */
- ast_mutex_unlock(&pri->lock);
- PRI_DEADLOCK_AVOIDANCE(pri->pvts[chanpos]);
- ast_mutex_lock(&pri->lock);
+
+ /* Avoid deadlock */
+ sig_pri_unlock_private(pri->pvts[chanpos]);
+ DEADLOCK_AVOIDANCE(&pri->lock);
+ sig_pri_lock_private(pri->pvts[chanpos]);
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sig_ss7.c
^
|
@@ -67,13 +67,6 @@
return "Unknown";
}
-#define SIG_SS7_DEADLOCK_AVOIDANCE(p) \
- do { \
- sig_ss7_unlock_private(p); \
- usleep(1); \
- sig_ss7_lock_private(p); \
- } while (0)
-
static void sig_ss7_unlock_private(struct sig_ss7_chan *p)
{
if (p->calls->unlock_private) {
@@ -304,10 +297,11 @@
/* We got the lock */
break;
}
- /* We must unlock the SS7 to avoid the possibility of a deadlock */
- ast_mutex_unlock(&ss7->lock);
- SIG_SS7_DEADLOCK_AVOIDANCE(ss7->pvts[chanpos]);
- ast_mutex_lock(&ss7->lock);
+
+ /* Avoid deadlock */
+ sig_ss7_unlock_private(ss7->pvts[chanpos]);
+ DEADLOCK_AVOIDANCE(&ss7->lock);
+ sig_ss7_lock_private(ss7->pvts[chanpos]);
}
}
@@ -1256,17 +1250,17 @@
static void ss7_grab(struct sig_ss7_chan *pvt, struct sig_ss7_linkset *ss7)
{
- int res;
/* Grab the lock first */
- do {
- res = ast_mutex_trylock(&ss7->lock);
- if (res) {
- SIG_SS7_DEADLOCK_AVOIDANCE(pvt);
- }
- } while (res);
+ while (ast_mutex_trylock(&ss7->lock)) {
+ /* Avoid deadlock */
+ sig_ss7_unlock_private(pvt);
+ sched_yield();
+ sig_ss7_lock_private(pvt);
+ }
/* Then break the poll */
- if (ss7->master != AST_PTHREADT_NULL)
+ if (ss7->master != AST_PTHREADT_NULL) {
pthread_kill(ss7->master, SIGURG);
+ }
}
/*!
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sip/config_parser.c
^
|
@@ -21,7 +21,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 350679 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366882 $")
#include "include/sip.h"
#include "include/config_parser.h"
@@ -530,7 +530,48 @@
ast_string_field_free_memory(reg);
ast_free(reg);
- /* ---Test reg12, add domain port --- */
+ /* ---Test reg 9, missing domain, expected to fail --- */
+ if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+ goto alloc_fail;
+ } else if (!sip_parse_register_line(reg, default_expiry, reg9, 1)) {
+ ast_test_status_update(test,
+ "Test 9, missing domain, expected to fail but did not.\n");
+ res = AST_TEST_FAIL;
+ }
+ ast_string_field_free_memory(reg);
+ ast_free(reg);
+
+ /* ---Test reg 10, missing user, expected to fail --- */
+ if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+ goto alloc_fail;
+ } else if (!sip_parse_register_line(reg, default_expiry, reg10, 1)) {
+ ast_test_status_update(test,
+ "Test 10, missing user expected to fail but did not\n");
+ res = AST_TEST_FAIL;
+ }
+ ast_string_field_free_memory(reg);
+ ast_free(reg);
+
+ /* ---Test reg 11, no registry object, expected to fail--- */
+ if (!sip_parse_register_line(NULL, default_expiry, reg1, 1)) {
+ ast_test_status_update(test,
+ "Test 11, no registry object, expected to fail but did not.\n");
+ res = AST_TEST_FAIL;
+ }
+
+ /* ---Test reg 12, no registry line, expected to fail --- */
+ if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+ goto alloc_fail;
+ } else if (!sip_parse_register_line(reg, default_expiry, NULL, 1)) {
+
+ ast_test_status_update(test,
+ "Test 12, NULL register line expected to fail but did not.\n");
+ res = AST_TEST_FAIL;
+ }
+ ast_string_field_free_memory(reg);
+ ast_free(reg);
+
+ /* ---Test reg13, add domain port --- */
if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
goto alloc_fail;
} else if (
@@ -553,11 +594,13 @@
reg->callid_valid != FALSE ||
reg->ocseq != INITIAL_CSEQ) {
- ast_test_status_update(test, "Test 12, add domain port failed.\n");
+ ast_test_status_update(test, "Test 13, add domain port failed.\n");
res = AST_TEST_FAIL;
}
+ ast_string_field_free_memory(reg);
+ ast_free(reg);
- /* ---Test reg13, domain port without secret --- */
+ /* ---Test reg14, domain port without secret --- */
if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
goto alloc_fail;
} else if (
@@ -580,46 +623,7 @@
reg->callid_valid != FALSE ||
reg->ocseq != INITIAL_CSEQ) {
- ast_test_status_update(test, "Test 13, domain port without secret failed.\n");
- res = AST_TEST_FAIL;
-}
-
- /* ---Test reg 9, missing domain, expected to fail --- */
- if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
- goto alloc_fail;
- } else if (!sip_parse_register_line(reg, default_expiry, reg9, 1)) {
- ast_test_status_update(test,
- "Test 9, missing domain, expected to fail but did not.\n");
- res = AST_TEST_FAIL;
- }
- ast_string_field_free_memory(reg);
- ast_free(reg);
-
- /* ---Test reg 10, missing user, expected to fail --- */
- if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
- goto alloc_fail;
- } else if (!sip_parse_register_line(reg, default_expiry, reg10, 1)) {
- ast_test_status_update(test,
- "Test 10, missing user expected to fail but did not\n");
- res = AST_TEST_FAIL;
- }
- ast_string_field_free_memory(reg);
- ast_free(reg);
-
- /* ---Test reg 11, no registry object, expected to fail--- */
- if (!sip_parse_register_line(NULL, default_expiry, reg1, 1)) {
- ast_test_status_update(test,
- "Test 11, no registry object, expected to fail but did not.\n");
- res = AST_TEST_FAIL;
- }
-
- /* ---Test reg 11, no registry line, expected to fail --- */
- if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
- goto alloc_fail;
- } else if (!sip_parse_register_line(reg, default_expiry, NULL, 1)) {
-
- ast_test_status_update(test,
- "Test 11, NULL register line expected to fail but did not.\n");
+ ast_test_status_update(test, "Test 14, domain port without secret failed.\n");
res = AST_TEST_FAIL;
}
ast_string_field_free_memory(reg);
@@ -638,6 +642,7 @@
char *port;
if (ast_strlen_zero(line)) {
+ *hostname = NULL;
return -1;
}
if ((*hostname = strstr(line, "://"))) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sip/include/sip.h
^
|
@@ -1056,6 +1056,7 @@
struct sip_auth_container *peerauth;/*!< Realm authentication credentials */
int noncecount; /*!< Nonce-count */
unsigned int stalenonce:1; /*!< Marks the current nonce as responded too */
+ unsigned int ongoing_reinvite:1; /*!< There is a reinvite in progress that might need to be cleaned up */
char lastmsg[256]; /*!< Last Message sent/received */
int amaflags; /*!< AMA Flags */
uint32_t pendinginvite; /*!< Any pending INVITE or state NOTIFY (in subscribe pvt's) ? (seqno of this) */
@@ -1068,6 +1069,7 @@
int initid; /*!< Auto-congest ID if appropriate (scheduler) */
int waitid; /*!< Wait ID for scheduler after 491 or other delays */
+ int reinviteid; /*!< Reinvite in case of provisional, but no final response */
int autokillid; /*!< Auto-kill ID (scheduler) */
int t38id; /*!< T.38 Response ID */
struct sip_refer *refer; /*!< REFER: SIP transfer data structure */
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/channels/sip/reqresp_parser.c
^
|
@@ -21,7 +21,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 351618 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include "include/sip.h"
#include "include/sip_utils.h"
@@ -217,7 +217,7 @@
}
-AST_TEST_DEFINE(sip_parse_uri_fully_test)
+AST_TEST_DEFINE(sip_parse_uri_full_test)
{
int res = AST_TEST_PASS;
char uri[1024];
@@ -227,12 +227,6 @@
struct testdata {
char *desc;
char *uri;
- char **userptr;
- char **passptr;
- char **hostportptr;
- char **headersptr;
- char **residueptr;
- struct uriparams *paramsptr;
char *user;
char *pass;
char *hostport;
@@ -250,12 +244,6 @@
struct testdata td1 = {
.desc = "no headers",
.uri = "sip:user:secret@host:5060;param=discard;transport=tcp;param2=residue",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -269,12 +257,6 @@
struct testdata td2 = {
.desc = "with headers",
.uri = "sip:user:secret@host:5060;param=discard;transport=tcp;param2=discard2?header=blah&header2=blah2;param3=residue",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -288,12 +270,6 @@
struct testdata td3 = {
.desc = "difficult user",
.uri = "sip:-_.!~*'()&=+$,;?/:secret@host:5060;transport=tcp",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "-_.!~*'()&=+$,;?/",
.pass = "secret",
.hostport = "host:5060",
@@ -307,12 +283,6 @@
struct testdata td4 = {
.desc = "difficult pass",
.uri = "sip:user:-_.!~*'()&=+$,@host:5060;transport=tcp",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "-_.!~*'()&=+$,",
.hostport = "host:5060",
@@ -326,12 +296,6 @@
struct testdata td5 = {
.desc = "difficult host",
.uri = "sip:user:secret@1-1.a-1.:5060;transport=tcp",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "1-1.a-1.:5060",
@@ -345,12 +309,6 @@
struct testdata td6 = {
.desc = "difficult params near transport",
.uri = "sip:user:secret@host:5060;-_.!~*'()[]/:&+$=-_.!~*'()[]/:&+$;transport=tcp",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -364,12 +322,6 @@
struct testdata td7 = {
.desc = "difficult params near headers",
.uri = "sip:user:secret@host:5060;-_.!~*'()[]/:&+$=-_.!~*'()[]/:&+$?header=blah&header2=blah2;-_.!~*'()[]/:&+$=residue",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -383,12 +335,6 @@
struct testdata td8 = {
.desc = "lr parameter",
.uri = "sip:user:secret@host:5060;param=discard;lr?header=blah",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -402,12 +348,6 @@
struct testdata td9 = {
.desc = "alternative lr parameter",
.uri = "sip:user:secret@host:5060;param=discard;lr=yes?header=blah",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -421,12 +361,6 @@
struct testdata td10 = {
.desc = "no lr parameter",
.uri = "sip:user:secret@host:5060;paramlr=lr;lr=no;lr=off;lr=0;lr=;=lr;lrextra;lrparam2=lr?header=blah",
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.user = "user",
.pass = "secret",
.hostport = "host:5060",
@@ -469,19 +403,19 @@
params.lr = 0;
ast_copy_string(uri,testdataptr->uri,sizeof(uri));
- if (parse_uri_full(uri, "sip:,sips:", testdataptr->userptr,
- testdataptr->passptr, testdataptr->hostportptr,
- testdataptr->paramsptr,
- testdataptr->headersptr,
- testdataptr->residueptr) ||
- ((testdataptr->userptr) && strcmp(testdataptr->user, user)) ||
- ((testdataptr->passptr) && strcmp(testdataptr->pass, pass)) ||
- ((testdataptr->hostportptr) && strcmp(testdataptr->hostport, hostport)) ||
- ((testdataptr->headersptr) && strcmp(testdataptr->headers, headers)) ||
- ((testdataptr->residueptr) && strcmp(testdataptr->residue, residue)) ||
- ((testdataptr->paramsptr) && strcmp(testdataptr->params.transport,params.transport)) ||
- ((testdataptr->paramsptr) && (testdataptr->params.lr != params.lr)) ||
- ((testdataptr->paramsptr) && strcmp(testdataptr->params.user,params.user))
+ if (parse_uri_full(uri, "sip:,sips:", &user,
+ &pass, &hostport,
+ ¶ms,
+ &headers,
+ &residue) ||
+ (user && strcmp(testdataptr->user, user)) ||
+ (pass && strcmp(testdataptr->pass, pass)) ||
+ (hostport && strcmp(testdataptr->hostport, hostport)) ||
+ (headers && strcmp(testdataptr->headers, headers)) ||
+ (residue && strcmp(testdataptr->residue, residue)) ||
+ (strcmp(testdataptr->params.transport,params.transport)) ||
+ (testdataptr->params.lr != params.lr) ||
+ (strcmp(testdataptr->params.user,params.user))
) {
ast_test_status_update(test, "Sub-Test: %s, failed.\n", testdataptr->desc);
res = AST_TEST_FAIL;
@@ -1220,13 +1154,6 @@
struct testdata {
char *desc;
char *uri;
- char **nameptr;
- char **userptr;
- char **passptr;
- char **hostportptr;
- char **headersptr;
- char **residueptr;
- struct uriparams *paramsptr;
char *name;
char *user;
char *pass;
@@ -1244,13 +1171,6 @@
struct testdata td1 = {
.desc = "quotes and brackets",
.uri = "\"name :@ \" <sip:user:secret@host:5060;param=discard;transport=tcp>;tag=tag",
- .nameptr = &name,
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.name = "name :@ ",
.user = "user",
.pass = "secret",
@@ -1265,13 +1185,6 @@
struct testdata td2 = {
.desc = "no quotes",
.uri = "givenname familyname <sip:user:secret@host:5060;param=discard;transport=tcp>;expires=3600",
- .nameptr = &name,
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.name = "givenname familyname",
.user = "user",
.pass = "secret",
@@ -1286,13 +1199,6 @@
struct testdata td3 = {
.desc = "no brackets",
.uri = "sip:user:secret@host:5060;param=discard;transport=tcp;q=1",
- .nameptr = &name,
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.name = "",
.user = "user",
.pass = "secret",
@@ -1307,13 +1213,6 @@
struct testdata td4 = {
.desc = "just host",
.uri = "sips:host",
- .nameptr = &name,
- .userptr = &user,
- .passptr = &pass,
- .hostportptr = &hostport,
- .headersptr = &headers,
- .residueptr = &residue,
- .paramsptr = ¶ms,
.name = "",
.user = "",
.pass = "",
@@ -1351,21 +1250,21 @@
params.lr = 0;
ast_copy_string(uri,testdataptr->uri,sizeof(uri));
if (parse_name_andor_addr(uri, "sip:,sips:",
- testdataptr->nameptr,
- testdataptr->userptr,
- testdataptr->passptr,
- testdataptr->hostportptr,
- testdataptr->paramsptr,
- testdataptr->headersptr,
- testdataptr->residueptr) ||
- ((testdataptr->nameptr) && strcmp(testdataptr->name, name)) ||
- ((testdataptr->userptr) && strcmp(testdataptr->user, user)) ||
- ((testdataptr->passptr) && strcmp(testdataptr->pass, pass)) ||
- ((testdataptr->hostportptr) && strcmp(testdataptr->hostport, hostport)) ||
- ((testdataptr->headersptr) && strcmp(testdataptr->headers, headers)) ||
- ((testdataptr->residueptr) && strcmp(testdataptr->residue, residue)) ||
- ((testdataptr->paramsptr) && strcmp(testdataptr->params.transport,params.transport)) ||
- ((testdataptr->paramsptr) && strcmp(testdataptr->params.user,params.user))
+ &name,
+ &user,
+ &pass,
+ &hostport,
+ ¶ms,
+ &headers,
+ &residue) ||
+ (name && strcmp(testdataptr->name, name)) ||
+ (user && strcmp(testdataptr->user, user)) ||
+ (pass && strcmp(testdataptr->pass, pass)) ||
+ (hostport && strcmp(testdataptr->hostport, hostport)) ||
+ (headers && strcmp(testdataptr->headers, headers)) ||
+ (residue && strcmp(testdataptr->residue, residue)) ||
+ (strcmp(testdataptr->params.transport,params.transport)) ||
+ (strcmp(testdataptr->params.user,params.user))
) {
ast_test_status_update(test, "Sub-Test: %s,failed.\n", testdataptr->desc);
res = AST_TEST_FAIL;
@@ -2579,7 +2478,7 @@
AST_TEST_REGISTER(sip_parse_uri_test);
AST_TEST_REGISTER(get_in_brackets_test);
AST_TEST_REGISTER(get_name_and_number_test);
- AST_TEST_REGISTER(sip_parse_uri_fully_test);
+ AST_TEST_REGISTER(sip_parse_uri_full_test);
AST_TEST_REGISTER(parse_name_andor_addr_test);
AST_TEST_REGISTER(parse_contact_header_test);
AST_TEST_REGISTER(sip_parse_options_test);
@@ -2592,7 +2491,7 @@
AST_TEST_UNREGISTER(get_calleridname_test);
AST_TEST_UNREGISTER(get_in_brackets_test);
AST_TEST_UNREGISTER(get_name_and_number_test);
- AST_TEST_UNREGISTER(sip_parse_uri_fully_test);
+ AST_TEST_UNREGISTER(sip_parse_uri_full_test);
AST_TEST_UNREGISTER(parse_name_andor_addr_test);
AST_TEST_UNREGISTER(parse_contact_header_test);
AST_TEST_UNREGISTER(sip_parse_options_test);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/codecs/codec_dahdi.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358484 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365989 $")
#include <fcntl.h>
#include <netinet/in.h>
@@ -56,6 +56,7 @@
#define G723_SAMPLES 240
#define G729_SAMPLES 160
+#define ULAW_SAMPLES 160
static struct channel_usage {
int total;
@@ -89,6 +90,7 @@
unsigned int fake:2;
uint16_t required_samples;
uint16_t samples_in_buffer;
+ uint16_t samples_written_to_hardware;
uint8_t ulaw_buffer[1024];
};
@@ -160,7 +162,6 @@
static void dahdi_write_frame(struct codec_dahdi_pvt *dahdip, const uint8_t *buffer, const ssize_t count)
{
int res;
- struct pollfd p = {0};
if (!count) return;
res = write(dahdip->fd, buffer, count);
if (option_verbose > 10) {
@@ -171,9 +172,6 @@
ast_log(LOG_ERROR, "Requested write of %zd bytes, but only wrote %d bytes.\n", count, res);
}
}
- p.fd = dahdip->fd;
- p.events = POLLOUT;
- res = poll(&p, 1, 50);
}
static int dahdi_encoder_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
@@ -206,8 +204,9 @@
dahdip->samples_in_buffer += f->samples;
}
- while (dahdip->samples_in_buffer > dahdip->required_samples) {
+ while (dahdip->samples_in_buffer >= dahdip->required_samples) {
dahdi_write_frame(dahdip, dahdip->ulaw_buffer, dahdip->required_samples);
+ dahdip->samples_written_to_hardware += dahdip->required_samples;
dahdip->samples_in_buffer -= dahdip->required_samples;
if (dahdip->samples_in_buffer) {
/* Shift any remaining bytes down. */
@@ -220,6 +219,14 @@
return -1;
}
+static void dahdi_wait_for_packet(int fd)
+{
+ struct pollfd p = {0};
+ p.fd = fd;
+ p.events = POLLIN;
+ poll(&p, 1, 10);
+}
+
static struct ast_frame *dahdi_encoder_frameout(struct ast_trans_pvt *pvt)
{
struct codec_dahdi_pvt *dahdip = pvt->pvt;
@@ -243,6 +250,10 @@
return NULL;
}
+ if (dahdip->samples_written_to_hardware >= dahdip->required_samples) {
+ dahdi_wait_for_packet(dahdip->fd);
+ }
+
res = read(dahdip->fd, pvt->outbuf.c + pvt->datalen, pvt->t->buf_size - pvt->datalen);
if (-1 == res) {
if (EWOULDBLOCK == errno) {
@@ -262,6 +273,10 @@
pvt->f.data.ptr = pvt->outbuf.c;
pvt->f.samples = ast_codec_get_samples(&pvt->f);
+ dahdip->samples_written_to_hardware =
+ (dahdip->samples_written_to_hardware >= pvt->f.samples) ?
+ dahdip->samples_written_to_hardware - pvt->f.samples : 0;
+
pvt->samples = 0;
pvt->datalen = 0;
return ast_frisolate(&pvt->f);
@@ -288,6 +303,7 @@
}
}
dahdi_write_frame(dahdip, f->data.ptr, f->datalen);
+ dahdip->samples_written_to_hardware += f->samples;
pvt->samples += f->samples;
pvt->datalen = 0;
return -1;
@@ -315,6 +331,10 @@
return NULL;
}
+ if (dahdip->samples_written_to_hardware >= ULAW_SAMPLES) {
+ dahdi_wait_for_packet(dahdip->fd);
+ }
+
/* Let's check to see if there is a new frame for us.... */
if (dahdip->softslin) {
res = read(dahdip->fd, dahdip->ulaw_buffer, sizeof(dahdip->ulaw_buffer));
@@ -346,6 +366,9 @@
pvt->f.data.ptr = pvt->outbuf.c;
pvt->f.samples = res;
pvt->samples = 0;
+ dahdip->samples_written_to_hardware =
+ (dahdip->samples_written_to_hardware >= res) ?
+ dahdip->samples_written_to_hardware - res : 0;
return ast_frisolate(&pvt->f);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_aes.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365398 $")
#include "asterisk/module.h"
#include "asterisk/pbx.h"
@@ -114,6 +114,10 @@
ast_aes_set_encrypt_key((unsigned char *) args.key, &ecx); /* encryption: plaintext -> encryptedtext -> base64 */
ast_aes_set_decrypt_key((unsigned char *) args.key, &dcx); /* decryption: base64 -> encryptedtext -> plaintext */
tmp = ast_calloc(1, len); /* requires a tmp buffer for the base64 decode */
+ if (!tmp) {
+ ast_log(LOG_ERROR, "Unable to allocate memory for data\n");
+ return -1;
+ }
tmpP = tmp;
encrypt = strcmp("AES_DECRYPT", cmd); /* -1 if encrypting, 0 if decrypting */
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_cdr.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 354749 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366048 $")
#include "asterisk/module.h"
#include "asterisk/channel.h"
@@ -197,7 +197,7 @@
static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
char *buf, size_t len)
{
- char *ret;
+ char *ret = NULL;
struct ast_flags flags = { 0 };
struct ast_cdr *cdr;
AST_DECLARE_APP_ARGS(args,
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_channel.c
^
|
@@ -30,7 +30,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368092 $")
#include <regex.h>
#include <ctype.h>
@@ -250,6 +250,26 @@
<para>R/O PRI Nonzero if the channel has no B channel.
The channel is either on hold or a call waiting call.</para>
</enum>
+ <enum name="buffers">
+ <para>W/O Change the channel's buffer policy (for the current call only)</para>
+ <para>This option takes two arguments:</para>
+ <para> Number of buffers,</para>
+ <para> Buffer policy being one of:</para>
+ <para> <literal>full</literal></para>
+ <para> <literal>immediate</literal></para>
+ <para> <literal>half</literal></para>
+ </enum>
+ <enum name="echocan_mode">
+ <para>W/O Change the configuration of the active echo
+ canceller on the channel (if any), for the current call
+ only.</para>
+ <para>Possible values are:</para>
+ <para> <literal>on</literal> Normal mode (the echo canceller is actually reinitalized)</para>
+ <para> <literal>off</literal> Disabled</para>
+ <para> <literal>fax</literal> FAX/data mode (NLP disabled if possible, otherwise
+ completely disabled)</para>
+ <para> <literal>voice</literal> Voice mode (returns from FAX mode, reverting the changes that were made)</para>
+ </enum>
</enumlist>
</parameter>
</syntax>
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_devstate.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361201 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366094 $")
#include "asterisk/module.h"
#include "asterisk/channel.h"
@@ -187,6 +187,7 @@
{
char buf[256] = "";
+ /* Ignore check_return warning from Coverity fow ast_db_get below */
ast_db_get(astdb_family, data, buf, sizeof(buf));
return ast_devstate_val(buf);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_dialgroup.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 343336 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <sys/stat.h>
@@ -165,6 +165,7 @@
ao2_ref(entry, -1);
}
ao2_iterator_destroy(&i);
+ ao2_ref(grhead, -1);
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_lock.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 350311 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include <signal.h>
@@ -373,10 +373,15 @@
static int unlock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
- struct ast_datastore *lock_store = ast_channel_datastore_find(chan, &lock_info, NULL);
+ struct ast_datastore *lock_store;
struct channel_lock_frame *clframe;
AST_LIST_HEAD(, channel_lock_frame) *list;
+ if (!chan) {
+ return -1;
+ }
+
+ lock_store = ast_channel_datastore_find(chan, &lock_info, NULL);
if (!lock_store) {
ast_log(LOG_WARNING, "No datastore for dialplan locks. Nothing was ever locked!\n");
ast_copy_string(buf, "0", len);
@@ -417,26 +422,24 @@
static int lock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
- if (chan)
- ast_autoservice_start(chan);
-
+ if (!chan) {
+ return -1;
+ }
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 0) ? "0" : "1", len);
-
- if (chan)
- ast_autoservice_stop(chan);
+ ast_autoservice_stop(chan);
return 0;
}
static int trylock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
- if (chan)
- ast_autoservice_start(chan);
-
+ if (!chan) {
+ return -1;
+ }
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 1) ? "0" : "1", len);
-
- if (chan)
- ast_autoservice_stop(chan);
+ ast_autoservice_stop(chan);
return 0;
}
@@ -486,9 +489,11 @@
ast_custom_function_unregister(&trylock_function);
ast_custom_function_unregister(&unlock_function);
- pthread_cancel(broker_tid);
- pthread_kill(broker_tid, SIGURG);
- pthread_join(broker_tid, NULL);
+ if (broker_tid != AST_PTHREADT_NULL) {
+ pthread_cancel(broker_tid);
+ pthread_kill(broker_tid, SIGURG);
+ pthread_join(broker_tid, NULL);
+ }
AST_LIST_UNLOCK(&locklist);
@@ -500,7 +505,14 @@
int res = ast_custom_function_register(&lock_function);
res |= ast_custom_function_register(&trylock_function);
res |= ast_custom_function_register(&unlock_function);
- ast_pthread_create_background(&broker_tid, NULL, lock_broker, NULL);
+
+ if (ast_pthread_create_background(&broker_tid, NULL, lock_broker, NULL)) {
+ ast_log(LOG_ERROR, "Failed to start lock broker thread. Unloading func_lock module.\n");
+ broker_tid = AST_PTHREADT_NULL;
+ unload_module();
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_math.c
^
|
@@ -34,7 +34,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <math.h>
@@ -57,7 +57,7 @@
<replaceable>number1</replaceable><replaceable>op</replaceable><replaceable>number2</replaceable>
where the possible values for <replaceable>op</replaceable>
are:</para>
- <para>+,-,/,*,%,<<,>>,^,AND,OR,XOR,<,%gt;,>=,<=,== (and behave as their C equivalents)</para>
+ <para>+,-,/,*,%,<<,>>,^,AND,OR,XOR,<,>,<=,>=,== (and behave as their C equivalents)</para>
</parameter>
<parameter name="type">
<para>Wanted type of result:</para>
@@ -254,7 +254,7 @@
}
}
- if (!mvalue1 || !mvalue2) {
+ if (!mvalue2) {
ast_log(LOG_WARNING,
"Supply all the parameters - just this once, please\n");
return -1;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_odbc.c
^
|
@@ -34,7 +34,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 352291 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366944 $")
#include "asterisk/module.h"
#include "asterisk/file.h"
@@ -151,6 +151,11 @@
{
struct odbc_datastore *result = data;
struct odbc_datastore_row *row;
+
+ if (!result) {
+ return;
+ }
+
AST_LIST_LOCK(result);
while ((row = AST_LIST_REMOVE_HEAD(result, list))) {
ast_free(row);
@@ -539,6 +544,7 @@
pbx_builtin_setvar_helper(chan, "ODBCROWS", rowcount);
ast_autoservice_stop(chan);
}
+ odbc_datastore_free(resultset);
return -1;
}
@@ -553,6 +559,7 @@
pbx_builtin_setvar_helper(chan, "ODBCROWS", rowcount);
ast_autoservice_stop(chan);
}
+ odbc_datastore_free(resultset);
return -1;
}
@@ -578,6 +585,7 @@
pbx_builtin_setvar_helper(chan, "ODBCSTATUS", status);
ast_autoservice_stop(chan);
}
+ odbc_datastore_free(resultset);
return res1;
}
@@ -591,7 +599,7 @@
char *ptrcoldata;
if (!coldata) {
- ast_free(resultset);
+ odbc_datastore_free(resultset);
SQLCloseCursor(stmt);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
@@ -624,7 +632,7 @@
void *tmp = ast_realloc(resultset, sizeof(*resultset) + ast_str_strlen(colnames) + 1);
if (!tmp) {
ast_log(LOG_ERROR, "No space for a new resultset?\n");
- ast_free(resultset);
+ odbc_datastore_free(resultset);
SQLCloseCursor(stmt);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/funcs/func_speex.c
^
|
@@ -39,7 +39,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include <speex/speex_preprocess.h>
#include "asterisk/module.h"
@@ -200,6 +200,11 @@
struct speex_direction_info **sdi = NULL;
int is_new = 0;
+ if (strcasecmp(data, "rx") && strcasecmp(data, "tx")) {
+ ast_log(LOG_ERROR, "Invalid argument provided to the %s function\n", cmd);
+ return -1;
+ }
+
ast_channel_lock(chan);
if (!(datastore = ast_channel_datastore_find(chan, &speex_datastore, NULL))) {
ast_channel_unlock(chan);
@@ -224,15 +229,8 @@
if (!strcasecmp(data, "rx")) {
sdi = &si->rx;
- } else if (!strcasecmp(data, "tx")) {
- sdi = &si->tx;
} else {
- ast_log(LOG_ERROR, "Invalid argument provided to the %s function\n", cmd);
-
- if (is_new) {
- ast_datastore_free(datastore);
- return -1;
- }
+ sdi = &si->tx;
}
if (!*sdi) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/include/asterisk/cel.h
^
|
@@ -181,6 +181,15 @@
void ast_cel_check_retire_linkedid(struct ast_channel *chan);
/*!
+ * \brief Inform CEL that a new linkedid is being used
+ * \since 11
+ *
+ * \retval -1 error
+ * \retval 0 success
+ */
+int ast_cel_linkedid_ref(const char *linkedid);
+
+/*!
* \brief Create a fake channel from data in a CEL event
*
* \note
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/include/asterisk/channel.h
^
|
@@ -2124,9 +2124,12 @@
/*! Cancels an existing shutdown and returns to normal operation */
void ast_cancel_shutdown(void);
-/*! \return number of active/allocated channels */
+/*! \return number of channels available for lookup */
int ast_active_channels(void);
+/*! \return the number of channels not yet destroyed */
+int ast_undestroyed_channels(void);
+
/*! \return non-zero if Asterisk is being shut down */
int ast_shutting_down(void);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/include/asterisk/tcptls.h
^
|
@@ -190,9 +190,26 @@
* \version 1.6.1 changed desc parameter to be of ast_tcptls_session_args type
*/
void ast_tcptls_server_stop(struct ast_tcptls_session_args *desc);
+
+/*!
+ * \brief Set up an SSL server
+ *
+ * \param cfg Configuration for the SSL server
+ * \retval 1 Success
+ * \retval 0 Failure
+ */
int ast_ssl_setup(struct ast_tls_config *cfg);
/*!
+ * \brief free resources used by an SSL server
+ *
+ * \note This only needs to be called if ast_ssl_setup() was
+ * directly called first.
+ * \param cfg Configuration for the SSL server
+ */
+void ast_ssl_teardown(struct ast_tls_config *cfg);
+
+/*!
* \brief Used to parse conf files containing tls/ssl options.
*/
int ast_tls_read_conf(struct ast_tls_config *tls_cfg, struct ast_tcptls_session_args *tls_desc, const char *varname, const char *value);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/abstract_jb.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 297312 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365460 $")
#include "asterisk/frame.h"
#include "asterisk/channel.h"
@@ -406,6 +406,7 @@
case JB_IMPL_OK:
/* deliver the frame */
ast_write(chan, f);
+ /* Fall through intentionally */
case JB_IMPL_DROP:
jb_framelog("\tJB_GET {now=%ld}: %s frame with ts=%ld and len=%ld\n",
now, jb_get_actions[res], f->ts, f->len);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/acl.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 357665 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366094 $")
#include "asterisk/network.h"
@@ -533,7 +533,11 @@
if (ast_sockaddr_is_ipv6(addr)) {
if (ast_sockaddr_is_ipv4_mapped(addr)) {
/* IPv4 ACLs apply to IPv4-mapped addresses */
- ast_sockaddr_ipv4_mapped(addr, &mapped_addr);
+ if (!ast_sockaddr_ipv4_mapped(addr, &mapped_addr)) {
+ ast_log(LOG_ERROR, "%s provided to ast_sockaddr_ipv4_mapped could not be converted. That shouldn't be possible.\n",
+ ast_sockaddr_stringify(addr));
+ continue;
+ }
addr_to_use = &mapped_addr;
} else {
/* An IPv4 ACL does not apply to an IPv6 address */
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/app.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 364769 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -570,6 +570,9 @@
long pause_restart_point = 0;
long offset = 0;
+ if (!file) {
+ return -1;
+ }
if (offsetms) {
offset = *offsetms * 8; /* XXX Assumes 8kHz */
}
@@ -601,12 +604,10 @@
res = ast_answer(chan);
}
- if (file) {
- if ((end = strchr(file, ':'))) {
- if (!strcasecmp(end, ":end")) {
- *end = '\0';
- end++;
- }
+ if ((end = strchr(file, ':'))) {
+ if (!strcasecmp(end, ":end")) {
+ *end = '\0';
+ end++;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/asterisk.c
^
|
@@ -61,7 +61,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 364046 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367292 $")
#include "asterisk/_private.h"
@@ -1455,7 +1455,11 @@
ast_log(LOG_WARNING, "Unable to register network verboser?\n");
}
- ast_pthread_create_background(<hread, NULL, listener, NULL);
+ if (ast_pthread_create_background(<hread, NULL, listener, NULL)) {
+ ast_log(LOG_WARNING, "Unable to create listener thread.\n");
+ close(ast_socket);
+ return -1;
+ }
if (!ast_strlen_zero(ast_config_AST_CTL_OWNER)) {
struct passwd *pw;
@@ -1690,7 +1694,7 @@
for (;;) {
time(&e);
/* Wait up to 15 seconds for all channels to go away */
- if ((e - s) > 15 || !ast_active_channels() || shuttingdown != niceness) {
+ if ((e - s) > 15 || !ast_undestroyed_channels() || shuttingdown != niceness) {
break;
}
/* Sleep 1/10 of a second */
@@ -1704,7 +1708,7 @@
ast_verbose("Waiting for inactivity to perform %s...\n", restart ? "restart" : "halt");
}
for (;;) {
- if (!ast_active_channels() || shuttingdown != niceness) {
+ if (!ast_undestroyed_channels() || shuttingdown != niceness) {
break;
}
sleep(1);
@@ -3220,9 +3224,8 @@
sleep(120);
for (;;) {
- stat(canary_filename, &canary_stat);
now = ast_tvnow();
- if (now.tv_sec > canary_stat.st_mtime + 60) {
+ if (stat(canary_filename, &canary_stat) || now.tv_sec > canary_stat.st_mtime + 60) {
ast_log(LOG_WARNING,
"The canary is no more. He has ceased to be! "
"He's expired and gone to meet his maker! "
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/audiohook.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 355622 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365460 $")
#include <signal.h>
@@ -71,6 +71,7 @@
switch (type) {
case AST_AUDIOHOOK_TYPE_SPY:
ast_slinfactory_init(&audiohook->read_factory);
+ /* Fall through intentionally */
case AST_AUDIOHOOK_TYPE_WHISPER:
ast_slinfactory_init(&audiohook->write_factory);
break;
@@ -94,6 +95,7 @@
switch (audiohook->type) {
case AST_AUDIOHOOK_TYPE_SPY:
ast_slinfactory_destroy(&audiohook->read_factory);
+ /* Fall through intentionally */
case AST_AUDIOHOOK_TYPE_WHISPER:
ast_slinfactory_destroy(&audiohook->write_factory);
break;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/cdr.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include <signal.h>
@@ -573,7 +573,9 @@
lfrom = lfrom->next;
}
/* rip off the last entry and put a copy of the to at the end */
- llfrom->next = to;
+ if (llfrom) {
+ llfrom->next = to;
+ }
from = lfrom;
} else {
/* save copy of the current *to cdr */
@@ -589,10 +591,11 @@
}
from->next = NULL;
/* rip off the last entry and put a copy of the to at the end */
- if (llfrom == from)
+ if (llfrom == from) {
to = to->next = ast_cdr_dup(&tcdr);
- else
+ } else if (llfrom) {
to = llfrom->next = ast_cdr_dup(&tcdr);
+ }
from = lfrom;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/cel.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365068 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367292 $")
#include "asterisk/_private.h"
@@ -464,6 +464,31 @@
return tchan;
}
+int ast_cel_linkedid_ref(const char *linkedid)
+{
+ char *lid;
+
+ if (ast_strlen_zero(linkedid)) {
+ ast_log(LOG_ERROR, "The linkedid should never be empty\n");
+ return -1;
+ }
+
+ if (!(lid = ao2_find(linkedids, (void *) linkedid, OBJ_POINTER))) {
+ if (!(lid = ao2_alloc(strlen(linkedid) + 1, NULL))) {
+ return -1;
+ }
+ strcpy(lid, linkedid);
+ if (!ao2_link(linkedids, lid)) {
+ ao2_ref(lid, -1);
+ return -1;
+ }
+ /* Leave both the link and the alloc refs to show a count of 1 + the link */
+ }
+ /* If we've found, go ahead and keep the ref to increment count of how many channels
+ * have this linkedid. We'll clean it up in check_retire */
+ return 0;
+}
+
int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event_type,
const char *userdefevname, const char *extra, struct ast_channel *peer2)
{
@@ -480,22 +505,10 @@
/* Record the linkedid of new channels if we are tracking LINKEDID_END even if we aren't
* reporting on CHANNEL_START so we can track when to send LINKEDID_END */
if (cel_enabled && ast_cel_track_event(AST_CEL_LINKEDID_END) && event_type == AST_CEL_CHANNEL_START && chan->linkedid) {
- char *lid;
- if (!(lid = ao2_find(linkedids, (void *) chan->linkedid, OBJ_POINTER))) {
- if (!(lid = ao2_alloc(strlen(chan->linkedid) + 1, NULL))) {
- ast_mutex_unlock(&reload_lock);
- return -1;
- }
- strcpy(lid, chan->linkedid);
- if (!ao2_link(linkedids, lid)) {
- ao2_ref(lid, -1);
- ast_mutex_unlock(&reload_lock);
- return -1;
- }
- /* Leave both the link and the alloc refs to show a count of 1 + the link */
+ if (ast_cel_linkedid_ref(chan->linkedid)) {
+ ast_mutex_unlock(&reload_lock);
+ return -1;
}
- /* If we've found, go ahead and keep the ref to increment count of how many channels
- * have this linkedid. We'll clean it up in check_retire */
}
if (!cel_enabled || !ast_cel_track_event(event_type)) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/channel.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361142 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368405 $")
#include "asterisk/_private.h"
@@ -93,6 +93,7 @@
static int shutting_down;
static int uniqueint;
+static int chancount;
unsigned long global_fin, global_fout;
@@ -834,6 +835,11 @@
return channels ? ao2_container_count(channels) : 0;
}
+int ast_undestroyed_channels(void)
+{
+ return ast_atomic_fetchadd_int(&chancount, 0);
+}
+
/*! \brief Cancel a shutdown in progress */
void ast_cancel_shutdown(void)
{
@@ -1295,6 +1301,7 @@
ast_cdr_init(tmp->cdr, tmp);
ast_cdr_start(tmp->cdr);
+ ast_atomic_fetchadd_int(&chancount, +1);
ast_cel_report_event(tmp, AST_CEL_CHANNEL_START, NULL, NULL, NULL);
headp = &tmp->varshead;
@@ -2479,6 +2486,7 @@
*/
ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, device_name);
}
+ ast_atomic_fetchadd_int(&chancount, -1);
}
/*! \brief Free a dummy channel structure */
@@ -2762,13 +2770,7 @@
*/
while (chan->masq) {
ast_channel_unlock(chan);
- if (ast_do_masquerade(chan)) {
- ast_log(LOG_WARNING, "Failed to perform masquerade\n");
-
- /* Abort the loop or we might never leave. */
- ast_channel_lock(chan);
- break;
- }
+ ast_do_masquerade(chan);
ast_channel_lock(chan);
}
@@ -2784,6 +2786,7 @@
return 0;
}
+ /* Mark as a zombie so a masquerade cannot be setup on this channel. */
if (!(was_zombie = ast_test_flag(chan, AST_FLAG_ZOMBIE))) {
ast_set_flag(chan, AST_FLAG_ZOMBIE);
}
@@ -3132,22 +3135,23 @@
int fdno;
} *fdmap = NULL;
- if ((sz = n * AST_MAX_FDS + nfds)) {
- pfds = alloca(sizeof(*pfds) * sz);
- fdmap = alloca(sizeof(*fdmap) * sz);
- }
-
if (outfd)
*outfd = -99999;
if (exception)
*exception = 0;
+ if ((sz = n * AST_MAX_FDS + nfds)) {
+ pfds = alloca(sizeof(*pfds) * sz);
+ fdmap = alloca(sizeof(*fdmap) * sz);
+ } else {
+ /* nothing to allocate and no FDs to check */
+ return NULL;
+ }
+
/* Perform any pending masquerades */
for (x = 0; x < n; x++) {
- if (c[x]->masq && ast_do_masquerade(c[x])) {
- ast_log(LOG_WARNING, "Masquerade failed\n");
- *ms = -1;
- return NULL;
+ while (c[x]->masq) {
+ ast_do_masquerade(c[x]);
}
ast_channel_lock(c[x]);
@@ -3278,10 +3282,8 @@
/* See if this channel needs to be masqueraded */
- if (chan->masq && ast_do_masquerade(chan)) {
- ast_log(LOG_WARNING, "Failed to perform masquerade on %s\n", chan->name);
- *ms = -1;
- return NULL;
+ while (chan->masq) {
+ ast_do_masquerade(chan);
}
ast_channel_lock(chan);
@@ -3360,10 +3362,8 @@
struct ast_channel *winner = NULL;
for (i = 0; i < n; i++) {
- if (c[i]->masq && ast_do_masquerade(c[i])) {
- ast_log(LOG_WARNING, "Masquerade failed\n");
- *ms = -1;
- return NULL;
+ while (c[i]->masq) {
+ ast_do_masquerade(c[i]);
}
ast_channel_lock(c[i]);
@@ -3742,11 +3742,8 @@
*/
if (chan->masq) {
- if (ast_do_masquerade(chan))
- ast_log(LOG_WARNING, "Failed to perform masquerade\n");
- else
- f = &ast_null_frame;
- return f;
+ ast_do_masquerade(chan);
+ return &ast_null_frame;
}
/* if here, no masq has happened, lock the channel and proceed */
@@ -4804,12 +4801,9 @@
goto done;
/* Handle any pending masquerades */
- if (chan->masq) {
+ while (chan->masq) {
ast_channel_unlock(chan);
- if (ast_do_masquerade(chan)) {
- ast_log(LOG_WARNING, "Failed to perform masquerade\n");
- return res; /* no need to goto done: chan is already unlocked for masq */
- }
+ ast_do_masquerade(chan);
ast_channel_lock(chan);
}
if (chan->masqr) {
@@ -6102,11 +6096,13 @@
void ast_change_name(struct ast_channel *chan, const char *newname)
{
/* We must re-link, as the hash value will change here. */
- ao2_unlink(channels, chan);
+ ao2_lock(channels);
ast_channel_lock(chan);
+ ao2_unlink(channels, chan);
__ast_change_name_nolink(chan, newname);
- ast_channel_unlock(chan);
ao2_link(channels, chan);
+ ast_channel_unlock(chan);
+ ao2_unlock(channels);
}
void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child)
@@ -6163,8 +6159,7 @@
struct ast_var_t *current, *newvar;
/* Append variables from clone channel into original channel */
/* XXX Is this always correct? We have to in order to keep MACROS working XXX */
- if (AST_LIST_FIRST(&clonechan->varshead))
- AST_LIST_APPEND_LIST(&original->varshead, &clonechan->varshead, entries);
+ AST_LIST_APPEND_LIST(&original->varshead, &clonechan->varshead, entries);
/* then, dup the varshead list into the clone */
@@ -6240,15 +6235,17 @@
* see if the channel's old linkedid is now being retired */
static void ast_channel_change_linkedid(struct ast_channel *chan, const char *linkedid)
{
+ ast_assert(linkedid != NULL);
/* if the linkedid for this channel is being changed from something, check... */
- if (!ast_strlen_zero(chan->linkedid) && 0 != strcmp(chan->linkedid, linkedid)) {
- ast_cel_check_retire_linkedid(chan);
+ if (!strcmp(chan->linkedid, linkedid)) {
+ return;
}
+ ast_cel_check_retire_linkedid(chan);
ast_string_field_set(chan, linkedid, linkedid);
+ ast_cel_linkedid_ref(linkedid);
}
-
/*!
\brief Propagate the oldest linkedid between associated channels
@@ -6414,11 +6411,11 @@
*/
int ast_do_masquerade(struct ast_channel *original)
{
- format_t x;
+ int x;
int i;
- int res=0;
int origstate;
int visible_indication;
+ int clone_was_zombie = 0;/*!< TRUE if the clonechan was a zombie before the masquerade. */
struct ast_frame *current;
const struct ast_channel_tech *t;
void *t_pvt;
@@ -6433,8 +6430,9 @@
struct ast_cdr *cdr;
struct ast_datastore *xfer_ds;
struct xfer_masquerade_ds *xfer_colp;
- format_t rformat = original->readformat;
- format_t wformat = original->writeformat;
+ format_t rformat;
+ format_t wformat;
+ format_t tmp_format;
char newn[AST_CHANNEL_NAME];
char orig[AST_CHANNEL_NAME];
char masqn[AST_CHANNEL_NAME];
@@ -6445,53 +6443,60 @@
* original channel's backend. While the features are nice, which is the
* reason we're keeping it, it's still awesomely weird. XXX */
- /* The reasoning for the channels ao2_container lock here is complex.
- *
- * In order to check for a race condition, the original channel must
- * be locked. If it is determined that the masquerade should proceed
- * the original channel can absolutely not be unlocked until the end
- * of the function. Since after determining the masquerade should
- * continue requires the channels to be unlinked from the ao2_container,
- * the container lock must be held first to achieve proper locking order.
+ /*
+ * The reasoning for the channels ao2_container lock here is
+ * complex.
+ *
+ * There is a race condition that exists for this function.
+ * Since all pvt and channel locks must be let go before calling
+ * ast_do_masquerade, it is possible that it could be called
+ * multiple times for the same channel. In order to prevent the
+ * race condition with competing threads to do the masquerade
+ * and new masquerade attempts, the channels container must be
+ * locked for the entire masquerade. The original and clonechan
+ * need to be unlocked earlier to avoid potential deadlocks with
+ * the chan_local deadlock avoidance method.
+ *
+ * The container lock blocks competing masquerade attempts from
+ * starting as well as being necessary for proper locking order
+ * because the channels must to be unlinked to change their
+ * names.
+ *
+ * The original and clonechan locks must be held while the
+ * channel contents are shuffled around for the masquerade.
+ *
+ * The masq and masqr pointers need to be left alone until the
+ * masquerade has restabilized the channels to prevent another
+ * masquerade request until the AST_FLAG_ZOMBIE can be set on
+ * the clonechan.
*/
ao2_lock(channels);
- /* lock the original channel to determine if the masquerade is required or not */
- ast_channel_lock(original);
-
/*
- * This checks to see if the masquerade has already happened or
- * not. There is a race condition that exists for this
- * function. Since all pvt and channel locks must be let go
- * before calling do_masquerade, it is possible that it could be
- * called multiple times for the same channel. This check
- * verifies whether or not the masquerade has already been
- * completed by another thread.
+ * Lock the original channel to determine if the masquerade is
+ * still required.
*/
- while ((clonechan = original->masq) && ast_channel_trylock(clonechan)) {
- /*
- * A masq is needed but we could not get the clonechan lock
- * immediately. Since this function already holds the global
- * container lock, unlocking original for deadlock avoidance
- * will not result in any sort of masquerade race condition. If
- * masq is called by a different thread while this happens, it
- * will be stuck waiting until we unlock the container.
- */
- CHANNEL_DEADLOCK_AVOIDANCE(original);
- }
+ ast_channel_lock(original);
- /*
- * A final masq check must be done after deadlock avoidance for
- * clonechan above or we could get a double masq. This is
- * posible with ast_hangup at least.
- */
+ clonechan = original->masq;
if (!clonechan) {
- /* masq already completed by another thread, or never needed to be done to begin with */
+ /*
+ * The masq is already completed by another thread or never
+ * needed to be done to begin with.
+ */
ast_channel_unlock(original);
ao2_unlock(channels);
return 0;
}
+ /* Bump the refs to ensure that they won't dissapear on us. */
+ ast_channel_ref(original);
+ ast_channel_ref(clonechan);
+
+ /* unlink from channels container as name (which is the hash value) will change */
+ ao2_unlink(channels, original);
+ ao2_unlink(channels, clonechan);
+
/* Get any transfer masquerade connected line exchange data. */
xfer_ds = ast_channel_datastore_find(original, &xfer_ds_info, NULL);
if (xfer_ds) {
@@ -6502,31 +6507,27 @@
}
/*
- * Release any hold on the transferee channel before proceeding
- * with the masquerade.
+ * Stop any visible indication on the original channel so we can
+ * transfer it to the clonechan taking the original's place.
+ */
+ visible_indication = original->visible_indication;
+ ast_channel_unlock(original);
+ ast_indicate(original, -1);
+
+ /*
+ * Release any hold on the transferee channel before going any
+ * further with the masquerade.
*/
if (xfer_colp && xfer_colp->transferee_held) {
ast_indicate(clonechan, AST_CONTROL_UNHOLD);
}
- /* clear the masquerade channels */
- original->masq = NULL;
- clonechan->masqr = NULL;
-
- /* unlink from channels container as name (which is the hash value) will change */
- ao2_unlink(channels, original);
- ao2_unlink(channels, clonechan);
+ /* Start the masquerade channel contents rearangement. */
+ ast_channel_lock_both(original, clonechan);
ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
clonechan->name, clonechan->_state, original->name, original->_state);
- /*
- * Stop any visible indiction on the original channel so we can
- * transfer it to the clonechan taking the original's place.
- */
- visible_indication = original->visible_indication;
- ast_indicate(original, -1);
-
chans[0] = clonechan;
chans[1] = original;
ast_manager_event_multichan(EVENT_FLAG_CALL, "Masquerade", 2, chans,
@@ -6536,8 +6537,12 @@
"OriginalState: %s\r\n",
clonechan->name, ast_state2str(clonechan->_state), original->name, ast_state2str(original->_state));
- /* Having remembered the original read/write formats, we turn off any translation on either
- one */
+ /*
+ * Remember the original read/write formats. We turn off any
+ * translation on either one
+ */
+ rformat = original->readformat;
+ wformat = original->writeformat;
free_translation(clonechan);
free_translation(original);
@@ -6562,15 +6567,15 @@
original->tech = clonechan->tech;
clonechan->tech = t;
+ t_pvt = original->tech_pvt;
+ original->tech_pvt = clonechan->tech_pvt;
+ clonechan->tech_pvt = t_pvt;
+
/* Swap the cdrs */
cdr = original->cdr;
original->cdr = clonechan->cdr;
clonechan->cdr = cdr;
- t_pvt = original->tech_pvt;
- original->tech_pvt = clonechan->tech_pvt;
- clonechan->tech_pvt = t_pvt;
-
/* Swap the alertpipes */
for (i = 0; i < 2; i++) {
x = original->alertpipe[i];
@@ -6578,7 +6583,7 @@
clonechan->alertpipe[i] = x;
}
- /*
+ /*
* Swap the readq's. The end result should be this:
*
* 1) All frames should be on the new (original) channel.
@@ -6591,8 +6596,8 @@
*/
{
AST_LIST_HEAD_NOLOCK(, ast_frame) tmp_readq;
- AST_LIST_HEAD_SET_NOLOCK(&tmp_readq, NULL);
+ AST_LIST_HEAD_INIT_NOLOCK(&tmp_readq);
AST_LIST_APPEND_LIST(&tmp_readq, &original->readq, frame_list);
AST_LIST_APPEND_LIST(&original->readq, &clonechan->readq, frame_list);
@@ -6609,12 +6614,13 @@
}
/* Swap the raw formats */
- x = original->rawreadformat;
+ tmp_format = original->rawreadformat;
original->rawreadformat = clonechan->rawreadformat;
- clonechan->rawreadformat = x;
- x = original->rawwriteformat;
+ clonechan->rawreadformat = tmp_format;
+
+ tmp_format = original->rawwriteformat;
original->rawwriteformat = clonechan->rawwriteformat;
- clonechan->rawwriteformat = x;
+ clonechan->rawwriteformat = tmp_format;
clonechan->_softhangup = AST_SOFTHANGUP_DEV;
@@ -6626,23 +6632,6 @@
original->_state = clonechan->_state;
clonechan->_state = origstate;
- if (clonechan->tech->fixup && clonechan->tech->fixup(original, clonechan)) {
- ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clonechan->name);
- }
-
- /* Start by disconnecting the original's physical side */
- if (clonechan->tech->hangup && clonechan->tech->hangup(clonechan)) {
- ast_log(LOG_WARNING, "Hangup failed! Strange things may happen!\n");
- res = -1;
- goto done;
- }
-
- /*
- * We just hung up the physical side of the channel. Set the
- * new zombie to use the kill channel driver for safety.
- */
- clonechan->tech = &ast_kill_tech;
-
/* Mangle the name of the clone channel */
snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig); /* quick, hide the brains! */
__ast_change_name_nolink(clonechan, zombn);
@@ -6743,63 +6732,89 @@
ast_debug(1, "Putting channel %s in %s/%s formats\n", original->name,
ast_getformatname(wformat), ast_getformatname(rformat));
- /* Okay. Last thing is to let the channel driver know about all this mess, so he
- can fix up everything as best as possible */
- if (original->tech->fixup) {
- if (original->tech->fixup(clonechan, original)) {
- ast_log(LOG_WARNING, "Channel for type '%s' could not fixup channel %s\n",
- original->tech->type, original->name);
- res = -1;
- goto done;
- }
- } else
- ast_log(LOG_WARNING, "Channel type '%s' does not have a fixup routine (for %s)! Bad things may happen.\n",
+ /* Fixup the original clonechan's physical side */
+ if (original->tech->fixup && original->tech->fixup(clonechan, original)) {
+ ast_log(LOG_WARNING, "Channel type '%s' could not fixup channel %s, strange things may happen. (clonechan)\n",
original->tech->type, original->name);
+ }
- /*
- * If an indication is currently playing, maintain it on the channel
- * that is taking the place of original
- *
- * This is needed because the masquerade is swapping out in the internals
- * of this channel, and the new channel private data needs to be made
- * aware of the current visible indication (RINGING, CONGESTION, etc.)
- */
- if (visible_indication) {
- ast_indicate(original, visible_indication);
+ /* Fixup the original original's physical side */
+ if (clonechan->tech->fixup && clonechan->tech->fixup(original, clonechan)) {
+ ast_log(LOG_WARNING, "Channel type '%s' could not fixup channel %s, strange things may happen. (original)\n",
+ clonechan->tech->type, clonechan->name);
}
- /* Now, at this point, the "clone" channel is totally F'd up. We mark it as
- a zombie so nothing tries to touch it. If it's already been marked as a
- zombie, then free it now (since it already is considered invalid). */
+ /*
+ * Now, at this point, the "clone" channel is totally F'd up.
+ * We mark it as a zombie so nothing tries to touch it. If it's
+ * already been marked as a zombie, then we must free it (since
+ * it already is considered invalid).
+ *
+ * This must be done before we unlock clonechan to prevent
+ * setting up another masquerade on the clonechan.
+ */
if (ast_test_flag(clonechan, AST_FLAG_ZOMBIE)) {
- ast_debug(1, "Destroying channel clone '%s'\n", clonechan->name);
- ast_channel_unlock(clonechan);
- ast_manager_event(clonechan, EVENT_FLAG_CALL, "Hangup",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Cause: %d\r\n"
- "Cause-txt: %s\r\n",
- clonechan->name,
- clonechan->uniqueid,
- clonechan->hangupcause,
- ast_cause2str(clonechan->hangupcause)
- );
- clonechan = ast_channel_release(clonechan);
+ clone_was_zombie = 1;
} else {
- ast_debug(1, "Released clone lock on '%s'\n", clonechan->name);
ast_set_flag(clonechan, AST_FLAG_ZOMBIE);
ast_queue_frame(clonechan, &ast_null_frame);
}
+ /* clear the masquerade channels */
+ original->masq = NULL;
+ clonechan->masqr = NULL;
+
+ /*
+ * When we unlock original here, it can be immediately setup to
+ * masquerade again or hungup. The new masquerade or hangup
+ * will not actually happen until we release the channels
+ * container lock.
+ */
+ ast_channel_unlock(original);
+
+ /* Disconnect the original original's physical side */
+ if (clonechan->tech->hangup && clonechan->tech->hangup(clonechan)) {
+ ast_log(LOG_WARNING, "Hangup failed! Strange things may happen!\n");
+ } else {
+ /*
+ * We just hung up the original original's physical side of the
+ * channel. Set the new zombie to use the kill channel driver
+ * for safety.
+ */
+ clonechan->tech = &ast_kill_tech;
+ }
+
+ ast_channel_unlock(clonechan);
+
+ /*
+ * If an indication is currently playing, maintain it on the
+ * channel that is taking the place of original.
+ *
+ * This is needed because the masquerade is swapping out the
+ * internals of the channel, and the new channel private data
+ * needs to be made aware of the current visible indication
+ * (RINGING, CONGESTION, etc.)
+ */
+ if (visible_indication) {
+ ast_indicate(original, visible_indication);
+ }
+
+ ast_channel_lock(original);
+
/* Signal any blocker */
- if (ast_test_flag(original, AST_FLAG_BLOCKING))
+ if (ast_test_flag(original, AST_FLAG_BLOCKING)) {
pthread_kill(original->blocker, SIGURG);
+ }
+
ast_debug(1, "Done Masquerading %s (%d)\n", original->name, original->_state);
if ((bridged = ast_bridged_channel(original))) {
- ast_channel_lock(bridged);
+ ast_channel_ref(bridged);
+ ast_channel_unlock(original);
ast_indicate(bridged, AST_CONTROL_SRCCHANGE);
- ast_channel_unlock(bridged);
+ ast_channel_unref(bridged);
+ } else {
+ ast_channel_unlock(original);
}
ast_indicate(original, AST_CONTROL_SRCCHANGE);
@@ -6812,24 +6827,42 @@
masquerade_colp_transfer(original, xfer_colp);
}
-done:
if (xfer_ds) {
ast_datastore_free(xfer_ds);
}
- /* it is possible for the clone channel to disappear during this */
- if (clonechan) {
- ast_channel_unlock(original);
+
+ if (clone_was_zombie) {
+ ast_channel_lock(clonechan);
+ ast_debug(1, "Destroying channel clone '%s'\n", clonechan->name);
+ ast_manager_event(clonechan, EVENT_FLAG_CALL, "Hangup",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Cause: %d\r\n"
+ "Cause-txt: %s\r\n",
+ clonechan->name,
+ clonechan->uniqueid,
+ clonechan->hangupcause,
+ ast_cause2str(clonechan->hangupcause)
+ );
ast_channel_unlock(clonechan);
- ao2_link(channels, clonechan);
- ao2_link(channels, original);
+
+ /*
+ * Drop the system reference to destroy the channel since it is
+ * already unlinked.
+ */
+ ast_channel_unref(clonechan);
} else {
- ast_channel_unlock(original);
- ao2_link(channels, original);
+ ao2_link(channels, clonechan);
}
+ ao2_link(channels, original);
ao2_unlock(channels);
- return res;
+ /* Release our held safety references. */
+ ast_channel_unref(original);
+ ast_channel_unref(clonechan);
+
+ return 0;
}
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/cli.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 344661 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366944 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_MODULE_DIR */
@@ -2340,16 +2340,20 @@
max_equal = i;
}
- if (!(retstr = ast_malloc(max_equal + 1)))
+ if (!(retstr = ast_malloc(max_equal + 1))) {
+ ast_free(match_list);
return NULL;
-
+ }
+
ast_copy_string(retstr, match_list[1], max_equal + 1);
match_list[0] = retstr;
/* ensure that the array is NULL terminated */
if (matches + 1 >= match_list_len) {
- if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list))))
+ if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list)))) {
+ ast_free(retstr);
return NULL;
+ }
}
match_list[matches + 1] = NULL;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/config.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 364340 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/paths.h" /* use ast_config_AST_CONFIG_DIR */
#include "asterisk/network.h" /* we do some sockaddr manipulation here */
@@ -562,7 +562,11 @@
{
struct ast_category *cat = NULL;
- if (category && config->last_browse && (config->last_browse->name == category)) {
+ if (!category) {
+ return NULL;
+ }
+
+ if (config->last_browse && (config->last_browse->name == category)) {
cat = config->last_browse;
} else {
cat = ast_category_get(config, category);
@@ -1483,6 +1487,8 @@
if (unchanged) {
AST_LIST_UNLOCK(&cfmtime_head);
+ ast_free(comment_buffer);
+ ast_free(lline_buffer);
return CONFIG_STATUS_FILEUNCHANGED;
}
}
@@ -1637,13 +1643,13 @@
}
#endif
- if (cfg && cfg != CONFIG_STATUS_FILEUNCHANGED && cfg != CONFIG_STATUS_FILEINVALID && cfg->include_level == 1 && ast_test_flag(&flags, CONFIG_FLAG_WITHCOMMENTS)) {
+ if (ast_test_flag(&flags, CONFIG_FLAG_WITHCOMMENTS)) {
ast_free(comment_buffer);
ast_free(lline_buffer);
comment_buffer = NULL;
lline_buffer = NULL;
}
-
+
if (count == 0)
return NULL;
@@ -1896,7 +1902,7 @@
/* Dump section with any appropriate comment */
for (cmt = cat->precomments; cmt; cmt=cmt->next) {
char *cmtp = cmt->cmt;
- while (*cmtp == ';' && *(cmtp+1) == '!') {
+ while (cmtp && *cmtp == ';' && *(cmtp+1) == '!') {
char *cmtp2 = strchr(cmtp+1, '\n');
if (cmtp2)
cmtp = cmtp2+1;
@@ -2118,6 +2124,10 @@
clear_config_maps();
configtmp = ast_config_new();
+ if (!configtmp) {
+ ast_log(LOG_ERROR, "Unable to allocate memory for new config\n");
+ return -1;
+ }
configtmp->max_include_level = 1;
config = ast_config_internal_load(extconfig_conf, configtmp, flags, "", "extconfig");
if (config == CONFIG_STATUS_FILEINVALID) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/data.c
^
|
@@ -24,7 +24,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 275105 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/_private.h"
@@ -1042,6 +1042,7 @@
cmp_type = child->cmp_type;
if (sscanf(child->value, "%p", &node_ptr) <= 0) {
+ ao2_ref(child, -1);
return 1;
}
@@ -2186,6 +2187,7 @@
doc = ast_xml_new();
if (!doc) {
+ ast_data_free(res);
return NULL;
}
@@ -2496,18 +2498,20 @@
struct ast_data *internal = tree;
char *path, *ptr = NULL;
+ if (!elements) {
+ return NULL;
+ }
+
/* tree is the node we want to use to iterate? or we are going
* to iterate thow an internal node? */
- if (elements) {
- path = ast_strdupa(elements);
+ path = ast_strdupa(elements);
- ptr = strrchr(path, '/');
- if (ptr) {
- *ptr = '\0';
- internal = data_result_get_node(tree, path);
- if (!internal) {
- return NULL;
- }
+ ptr = strrchr(path, '/');
+ if (ptr) {
+ *ptr = '\0';
+ internal = data_result_get_node(tree, path);
+ if (!internal) {
+ return NULL;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/db.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 345682 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366094 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_DB */
@@ -778,7 +778,9 @@
return -1;
}
+ /* Ignore check_return warning from Coverity for dbinit below */
dbinit();
+
ast_cli_register_multiple(cli_database, ARRAY_LEN(cli_database));
ast_manager_register_xml("DBGet", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_dbget);
ast_manager_register_xml("DBPut", EVENT_FLAG_SYSTEM, manager_dbput);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/db1-ast/btree/bt_open.c
^
|
@@ -404,7 +404,7 @@
#else
path = malloc(n);
#endif
- (void)snprintf(path, n, fmt, envtmp ? envtmp : "/tmp");
+ (void)snprintf(path, n, fmt, envtmp);
(void)sigfillset(&set);
(void)sigprocmask(SIG_BLOCK, &set, &oset);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/devicestate.c
^
|
@@ -115,7 +115,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358943 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include "asterisk/_private.h"
#include "asterisk/channel.h"
@@ -330,9 +330,7 @@
/* We have a provider */
number = tech;
tech = NULL;
- }
- if (provider) {
ast_debug(3, "Checking if I can find provider for \"%s\" - number: %s\n", provider, number);
return getproviderstate(provider, number);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/editline/readline.c
^
|
@@ -549,6 +549,7 @@
from = strdup(search);
else {
from = NULL;
+ free(line);
return (-1);
}
}
@@ -609,8 +610,13 @@
end = max - ((end < -1) ? 1 : 0);
/* check boundaries ... */
- if (start > max || end > max || start > end)
+ if (start > max || end > max || start > end) {
+ for (i = 0; i <= max; i++) {
+ free(arr[i]);
+ }
+ free(arr), arr = (char **) NULL;
return (-1);
+ }
for (i = 0; i <= max; i++) {
char *temp;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/editline/term.c
^
|
@@ -472,7 +472,7 @@
private int
term_alloc_display(EditLine *el)
{
- int i;
+ int i, j;
char **b;
coord_t *c = &el->el_term.t_size;
@@ -481,8 +481,13 @@
return (-1);
for (i = 0; i < c->v; i++) {
b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
- if (b[i] == NULL)
+ if (b[i] == NULL) {
+ for (j = 0; j < i; j++) {
+ el_free(b[j]);
+ }
+ el_free(b);
return (-1);
+ }
}
b[c->v] = NULL;
el->el_display = b;
@@ -492,8 +497,13 @@
return (-1);
for (i = 0; i < c->v; i++) {
b[i] = (char *) el_malloc((size_t) (sizeof(char) * (c->h + 1)));
- if (b[i] == NULL)
+ if (b[i] == NULL) {
+ for (j = 0; j < i; j++) {
+ el_free(b[j]);
+ }
+ el_free(b);
return (-1);
+ }
}
b[c->v] = NULL;
el->el_vdisplay = b;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/editline/tokenizer.c
^
|
@@ -113,12 +113,17 @@
tok->argc = 0;
tok->amax = AINCR;
tok->argv = (char **) tok_malloc(sizeof(char *) * tok->amax);
- if (tok->argv == NULL)
+ if (tok->argv == NULL) {
+ tok_free(tok);
return (NULL);
+ }
tok->argv[0] = NULL;
tok->wspace = (char *) tok_malloc(WINCR);
- if (tok->wspace == NULL)
+ if (tok->wspace == NULL) {
+ tok_free(tok->argv);
+ tok_free(tok);
return (NULL);
+ }
tok->wmax = tok->wspace + WINCR;
tok->wstart = tok->wspace;
tok->wptr = tok->wspace;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/enum.c
^
|
@@ -47,7 +47,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 329471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <sys/socket.h>
#include <netinet/in.h>
@@ -790,6 +790,7 @@
if (sdl > strlen(number)) { /* Number too short for this sdl? */
ast_log(LOG_WARNING, "I-ENUM: subdomain location %d behind number %s\n", sdl, number);
+ ast_free(context);
return 0;
}
ast_copy_string(left, number + sdl, sizeof(left));
@@ -802,6 +803,7 @@
/* check the space we need for middle */
if ((sdl * 2 + strlen(middle) + 2) > sizeof(middle)) {
ast_log(LOG_WARNING, "ast_get_enum: not enough space for I-ENUM rewrite.\n");
+ ast_free(context);
return -1;
}
@@ -819,6 +821,7 @@
if (strlen(left) * 2 + 2 > sizeof(domain)) {
ast_log(LOG_WARNING, "string to long in ast_get_enum\n");
+ ast_free(context);
return -1;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/event.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 357940 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include "asterisk/_private.h"
@@ -1281,8 +1281,9 @@
break;
}
+ /* realloc inside one of the append functions failed */
if (!event) {
- break;
+ return NULL;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/features.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 364060 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369690 $")
#include "asterisk/_private.h"
@@ -1009,7 +1009,9 @@
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- ast_pthread_create(&thread, &attr, bridge_call_thread, data);
+ if (ast_pthread_create(&thread, &attr, bridge_call_thread, data)) {
+ ast_log(LOG_WARNING, "Failed to create thread for parked call.\n");
+ }
pthread_attr_destroy(&attr);
memset(&sched, 0, sizeof(sched));
pthread_setschedparam(thread, SCHED_RR, &sched);
@@ -2058,6 +2060,9 @@
struct ast_channel *caller_chan, *callee_chan;
const char *automon_message_start = NULL;
const char *automon_message_stop = NULL;
+ const char *touch_format = NULL;
+ const char *touch_monitor = NULL;
+ const char *touch_monitor_prefix = NULL;
if (!monitor_ok) {
ast_log(LOG_ERROR,"Cannot record the call. The monitor application is disabled.\n");
@@ -2071,10 +2076,10 @@
}
set_peers(&caller_chan, &callee_chan, peer, chan, sense);
- if (caller_chan) { /* Find extra messages */
- automon_message_start = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_MESSAGE_START");
- automon_message_stop = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_MESSAGE_STOP");
- }
+
+ /* Find extra messages */
+ automon_message_start = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_MESSAGE_START");
+ automon_message_stop = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_MESSAGE_STOP");
if (!ast_strlen_zero(courtesytone)) { /* Play courtesy tone if configured */
if(play_message_in_bridged_call(caller_chan, callee_chan, courtesytone) == -1) {
@@ -2091,58 +2096,53 @@
return AST_FEATURE_RETURN_SUCCESS;
}
- if (caller_chan && callee_chan) {
- const char *touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_FORMAT");
- const char *touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR");
- const char *touch_monitor_prefix = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_PREFIX");
-
- if (!touch_format)
- touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_FORMAT");
+ touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_FORMAT");
+ touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR");
+ touch_monitor_prefix = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_PREFIX");
+
+ if (!touch_format)
+ touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_FORMAT");
+
+ if (!touch_monitor)
+ touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR");
+
+ if (!touch_monitor_prefix)
+ touch_monitor_prefix = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_PREFIX");
+
+ if (touch_monitor) {
+ len = strlen(touch_monitor) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+ snprintf(touch_filename, len, "%s-%ld-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), touch_monitor);
+ snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
+ } else {
+ caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
+ caller_chan->caller.id.number.str, caller_chan->name));
+ callee_chan_id = ast_strdupa(S_COR(callee_chan->caller.id.number.valid,
+ callee_chan->caller.id.number.str, callee_chan->name));
+ len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+ snprintf(touch_filename, len, "%s-%ld-%s-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), caller_chan_id, callee_chan_id);
+ snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
+ }
- if (!touch_monitor)
- touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR");
-
- if (!touch_monitor_prefix)
- touch_monitor_prefix = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_PREFIX");
+ for(x = 0; x < strlen(args); x++) {
+ if (args[x] == '/')
+ args[x] = '-';
+ }
- if (touch_monitor) {
- len = strlen(touch_monitor) + 50;
- args = alloca(len);
- touch_filename = alloca(len);
- snprintf(touch_filename, len, "%s-%ld-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), touch_monitor);
- snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
- } else {
- caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
- caller_chan->caller.id.number.str, caller_chan->name));
- callee_chan_id = ast_strdupa(S_COR(callee_chan->caller.id.number.valid,
- callee_chan->caller.id.number.str, callee_chan->name));
- len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
- args = alloca(len);
- touch_filename = alloca(len);
- snprintf(touch_filename, len, "%s-%ld-%s-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), caller_chan_id, callee_chan_id);
- snprintf(args, len, "%s,%s,m", S_OR(touch_format, "wav"), touch_filename);
- }
-
- for(x = 0; x < strlen(args); x++) {
- if (args[x] == '/')
- args[x] = '-';
- }
-
- ast_verb(4, "User hit '%s' to record call. filename: %s\n", code, args);
+ ast_verb(4, "User hit '%s' to record call. filename: %s\n", code, args);
- pbx_exec(callee_chan, monitor_app, args);
- pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
- pbx_builtin_setvar_helper(caller_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
+ pbx_exec(callee_chan, monitor_app, args);
+ pbx_builtin_setvar_helper(callee_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
+ pbx_builtin_setvar_helper(caller_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
- if (!ast_strlen_zero(automon_message_start)) { /* Play start message for both channels */
- play_message_in_bridged_call(caller_chan, callee_chan, automon_message_start);
- }
-
- return AST_FEATURE_RETURN_SUCCESS;
+ if (!ast_strlen_zero(automon_message_start)) { /* Play start message for both channels */
+ play_message_in_bridged_call(caller_chan, callee_chan, automon_message_start);
}
-
- ast_log(LOG_NOTICE,"Cannot record the call. One or both channels have gone away.\n");
- return -1;
+
+ return AST_FEATURE_RETURN_SUCCESS;
}
static int builtin_automixmonitor(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, const char *code, int sense, void *data)
@@ -2152,6 +2152,8 @@
size_t len;
struct ast_channel *caller_chan, *callee_chan;
const char *mixmonitor_spy_type = "MixMonitor";
+ const char *touch_format;
+ const char *touch_monitor;
int count = 0;
if (!mixmonitor_ok) {
@@ -2186,7 +2188,6 @@
/* This means a mixmonitor is attached to the channel, running or not is unknown. */
if (count > 0) {
-
ast_verb(3, "User hit '%s' to stop recording call.\n", code);
/* Make sure they are running */
@@ -2211,51 +2212,44 @@
ast_log(LOG_WARNING,"Stopped MixMonitors are attached to the channel.\n");
}
- if (caller_chan && callee_chan) {
- const char *touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MIXMONITOR_FORMAT");
- const char *touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MIXMONITOR");
-
- if (!touch_format)
- touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MIXMONITOR_FORMAT");
-
- if (!touch_monitor)
- touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MIXMONITOR");
-
- if (touch_monitor) {
- len = strlen(touch_monitor) + 50;
- args = alloca(len);
- touch_filename = alloca(len);
- snprintf(touch_filename, len, "auto-%ld-%s", (long)time(NULL), touch_monitor);
- snprintf(args, len, "%s.%s,b", touch_filename, (touch_format) ? touch_format : "wav");
- } else {
- caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
- caller_chan->caller.id.number.str, caller_chan->name));
- callee_chan_id = ast_strdupa(S_COR(callee_chan->caller.id.number.valid,
- callee_chan->caller.id.number.str, callee_chan->name));
- len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
- args = alloca(len);
- touch_filename = alloca(len);
- snprintf(touch_filename, len, "auto-%ld-%s-%s", (long)time(NULL), caller_chan_id, callee_chan_id);
- snprintf(args, len, "%s.%s,b", touch_filename, S_OR(touch_format, "wav"));
- }
-
- for( x = 0; x < strlen(args); x++) {
- if (args[x] == '/')
- args[x] = '-';
- }
-
- ast_verb(3, "User hit '%s' to record call. filename: %s\n", code, touch_filename);
-
- pbx_exec(callee_chan, mixmonitor_app, args);
- pbx_builtin_setvar_helper(callee_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
- pbx_builtin_setvar_helper(caller_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
- return AST_FEATURE_RETURN_SUCCESS;
-
- }
+ touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MIXMONITOR_FORMAT");
+ touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MIXMONITOR");
- ast_log(LOG_NOTICE,"Cannot record the call. One or both channels have gone away.\n");
- return -1;
+ if (!touch_format)
+ touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MIXMONITOR_FORMAT");
+ if (!touch_monitor)
+ touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MIXMONITOR");
+
+ if (touch_monitor) {
+ len = strlen(touch_monitor) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+ snprintf(touch_filename, len, "auto-%ld-%s", (long)time(NULL), touch_monitor);
+ snprintf(args, len, "%s.%s,b", touch_filename, (touch_format) ? touch_format : "wav");
+ } else {
+ caller_chan_id = ast_strdupa(S_COR(caller_chan->caller.id.number.valid,
+ caller_chan->caller.id.number.str, caller_chan->name));
+ callee_chan_id = ast_strdupa(S_COR(callee_chan->caller.id.number.valid,
+ callee_chan->caller.id.number.str, callee_chan->name));
+ len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
+ args = alloca(len);
+ touch_filename = alloca(len);
+ snprintf(touch_filename, len, "auto-%ld-%s-%s", (long)time(NULL), caller_chan_id, callee_chan_id);
+ snprintf(args, len, "%s.%s,b", touch_filename, S_OR(touch_format, "wav"));
+ }
+
+ for( x = 0; x < strlen(args); x++) {
+ if (args[x] == '/')
+ args[x] = '-';
+ }
+
+ ast_verb(3, "User hit '%s' to record call. filename: %s\n", code, touch_filename);
+
+ pbx_exec(callee_chan, mixmonitor_app, args);
+ pbx_builtin_setvar_helper(callee_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
+ pbx_builtin_setvar_helper(caller_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
+ return AST_FEATURE_RETURN_SUCCESS;
}
static int builtin_disconnect(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, const char *code, int sense, void *data)
@@ -2477,6 +2471,8 @@
struct ast_channel *transferer;/* Party B */
struct ast_channel *transferee;/* Party A */
struct ast_exten *park_exten;
+ const char *chan1_attended_sound;
+ const char *chan2_attended_sound;
const char *transferer_real_context;
char xferto[256] = "";
int res;
@@ -2549,16 +2545,13 @@
/* If we are performing an attended transfer and we have two channels involved then
copy sound file information to play upon attended transfer completion */
- if (transferee) {
- const char *chan1_attended_sound = pbx_builtin_getvar_helper(transferer, "ATTENDED_TRANSFER_COMPLETE_SOUND");
- const char *chan2_attended_sound = pbx_builtin_getvar_helper(transferee, "ATTENDED_TRANSFER_COMPLETE_SOUND");
-
- if (!ast_strlen_zero(chan1_attended_sound)) {
- pbx_builtin_setvar_helper(transferer, "BRIDGE_PLAY_SOUND", chan1_attended_sound);
- }
- if (!ast_strlen_zero(chan2_attended_sound)) {
- pbx_builtin_setvar_helper(transferee, "BRIDGE_PLAY_SOUND", chan2_attended_sound);
- }
+ chan1_attended_sound = pbx_builtin_getvar_helper(transferer, "ATTENDED_TRANSFER_COMPLETE_SOUND");
+ chan2_attended_sound = pbx_builtin_getvar_helper(transferee, "ATTENDED_TRANSFER_COMPLETE_SOUND");
+ if (!ast_strlen_zero(chan1_attended_sound)) {
+ pbx_builtin_setvar_helper(transferer, "BRIDGE_PLAY_SOUND", chan1_attended_sound);
+ }
+ if (!ast_strlen_zero(chan2_attended_sound)) {
+ pbx_builtin_setvar_helper(transferee, "BRIDGE_PLAY_SOUND", chan2_attended_sound);
}
/* Extract redial transferer information from the channel name. */
@@ -3162,12 +3155,10 @@
ast_autoservice_start(idle);
ast_autoservice_ignore(idle, AST_FRAME_DTMF_END);
- if(work && idle) {
- pbx_builtin_setvar_helper(work, "DYNAMIC_PEERNAME", idle->name);
- pbx_builtin_setvar_helper(idle, "DYNAMIC_PEERNAME", work->name);
- pbx_builtin_setvar_helper(work, "DYNAMIC_FEATURENAME", feature->sname);
- pbx_builtin_setvar_helper(idle, "DYNAMIC_FEATURENAME", feature->sname);
- }
+ pbx_builtin_setvar_helper(work, "DYNAMIC_PEERNAME", idle->name);
+ pbx_builtin_setvar_helper(idle, "DYNAMIC_PEERNAME", work->name);
+ pbx_builtin_setvar_helper(work, "DYNAMIC_FEATURENAME", feature->sname);
+ pbx_builtin_setvar_helper(idle, "DYNAMIC_FEATURENAME", feature->sname);
if (!ast_strlen_zero(feature->moh_class))
ast_moh_start(idle, feature->moh_class, NULL);
@@ -3282,7 +3273,9 @@
if (operation) {
res = fge->feature->operation(chan, peer, config, code, sense, fge->feature);
}
- memcpy(feature, fge->feature, sizeof(*feature));
+ if (feature) {
+ memcpy(feature, fge->feature, sizeof(*feature));
+ }
if (res != AST_FEATURE_RETURN_KEEPTRYING) {
AST_RWLIST_UNLOCK(&feature_groups);
break;
@@ -3345,9 +3338,11 @@
struct ast_flags features;
struct ast_call_feature feature;
if (sense == FEATURE_SENSE_CHAN) {
+ /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL);
}
else {
+ /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
ast_copy_flags(&features, &(config->features_callee), AST_FLAGS_ALL);
}
@@ -4609,7 +4604,6 @@
struct ast_channel *chan = pu->chan; /* shorthand */
int tms; /* timeout for this item */
int x; /* fd index in channel */
- int parking_complete = 0;
tms = ast_tvdiff_ms(ast_tvnow(), pu->start);
if (tms > pu->parkingtime) {
@@ -4724,8 +4718,11 @@
}
/* And take them out of the parking lot */
- parking_complete = 1;
- } else { /* still within parking time, process descriptors */
+ return 1;
+ }
+
+ /* still within parking time, process descriptors */
+ if (pfds) {
for (x = 0; x < AST_MAX_FDS; x++) {
struct ast_frame *f;
int y;
@@ -4774,8 +4771,7 @@
ast_hangup(chan);
/* And take them out of the parking lot */
- parking_complete = 1;
- break;
+ return 1;
} else {
/* XXX Maybe we could do something with packets, like dial "0" for operator or something XXX */
ast_frfree(f);
@@ -4791,33 +4787,34 @@
? strlen(pu->parkinglot->cfg.mohclass) + 1 : 0));
pu->moh_trys++;
}
- goto std; /* XXX Ick: jumping into an else statement??? XXX */
+ break;
}
} /* End for */
- if (x >= AST_MAX_FDS) {
-std: for (x = 0; x < AST_MAX_FDS; x++) { /* mark fds for next round */
- if (chan->fds[x] > -1) {
- void *tmp = ast_realloc(*new_pfds,
- (*new_nfds + 1) * sizeof(struct pollfd));
+ }
- if (!tmp) {
- continue;
- }
- *new_pfds = tmp;
- (*new_pfds)[*new_nfds].fd = chan->fds[x];
- (*new_pfds)[*new_nfds].events = POLLIN | POLLERR | POLLPRI;
- (*new_pfds)[*new_nfds].revents = 0;
- (*new_nfds)++;
- }
- }
- /* Keep track of our shortest wait */
- if (tms < *ms || *ms < 0) {
- *ms = tms;
+ /* mark fds for next round */
+ for (x = 0; x < AST_MAX_FDS; x++) {
+ if (chan->fds[x] > -1) {
+ void *tmp = ast_realloc(*new_pfds,
+ (*new_nfds + 1) * sizeof(struct pollfd));
+
+ if (!tmp) {
+ continue;
}
+ *new_pfds = tmp;
+ (*new_pfds)[*new_nfds].fd = chan->fds[x];
+ (*new_pfds)[*new_nfds].events = POLLIN | POLLERR | POLLPRI;
+ (*new_pfds)[*new_nfds].revents = 0;
+ (*new_nfds)++;
}
}
+ /* Keep track of our shortest wait */
+ if (tms < *ms || *ms < 0) {
+ *ms = tms;
+ }
- return parking_complete;
+ /* Stay in the parking lot. */
+ return 0;
}
/*! \brief Run management on parkinglots, called once per parkinglot */
@@ -5056,7 +5053,7 @@
/*! \brief Pickup parked call */
static int parked_call_exec(struct ast_channel *chan, const char *data)
{
- int res = 0;
+ int res;
struct ast_channel *peer = NULL;
struct parkeduser *pu;
struct ast_context *con;
@@ -5299,10 +5296,11 @@
}
ast_verb(3, "Channel %s tried to retrieve nonexistent parked call %d\n",
chan->name, park);
+ res = -1;
}
parkinglot_unref(parkinglot);
- return -1;
+ return res;
}
/*!
@@ -5645,7 +5643,7 @@
static void process_applicationmap_line(struct ast_variable *var)
{
char *tmp_val = ast_strdupa(var->value);
- char *activateon;
+ char *activateon, *new_syn;
struct ast_call_feature *feature;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(exten);
@@ -5656,10 +5654,10 @@
);
AST_STANDARD_APP_ARGS(args, tmp_val);
- if (strchr(args.app, '(')) {
+ if ((new_syn = strchr(args.app, '('))) {
/* New syntax */
args.moh_class = args.app_args;
- args.app_args = strchr(args.app, '(');
+ args.app_args = new_syn;
*args.app_args++ = '\0';
if (args.app_args[strlen(args.app_args) - 1] == ')') {
args.app_args[strlen(args.app_args) - 1] = '\0';
@@ -5716,6 +5714,7 @@
} else {
ast_log(LOG_NOTICE, "Invalid 'ActivateOn' specification for feature '%s',"
" must be 'self', or 'peer'\n", var->name);
+ ast_free(feature);
return;
}
@@ -5730,6 +5729,7 @@
} else {
ast_log(LOG_NOTICE, "Invalid 'ActivatedBy' specification for feature '%s',"
" must be 'caller', or 'callee', or 'both'\n", var->name);
+ ast_free(feature);
return;
}
@@ -8147,7 +8147,9 @@
return res;
}
ast_cli_register_multiple(cli_features, ARRAY_LEN(cli_features));
- ast_pthread_create(&parking_thread, NULL, do_parking_thread, NULL);
+ if (ast_pthread_create(&parking_thread, NULL, do_parking_thread, NULL)) {
+ return -1;
+ }
ast_register_application2(app_bridge, bridge_exec, NULL, NULL, NULL);
res = ast_register_application2(parkedcall, parked_call_exec, NULL, NULL, NULL);
if (!res)
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/http.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361803 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366650 $")
#include <time.h>
#include <sys/time.h>
@@ -61,7 +61,7 @@
#define MAX_PREFIX 80
#define DEFAULT_SESSION_LIMIT 100
-#define DEFAULT_HTTP_PORT 8080
+#define DEFAULT_HTTP_PORT 8088
#define DEFAULT_HTTPS_PORT 8089
/* See http.h for more information about the SSL implementation */
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/manager.c
^
|
@@ -47,7 +47,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 364841 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use various ast_config_AST_* */
@@ -4435,10 +4435,22 @@
const char *module = astman_get_header(m, "Module");
int res = ast_module_reload(S_OR(module, NULL));
- if (res == 2) {
+ switch (res) {
+ case -1:
+ astman_send_error(s, m, "A reload is in progress");
+ break;
+ case 0:
+ astman_send_error(s, m, "No such module");
+ break;
+ case 1:
+ astman_send_error(s, m, "Module does not support reload");
+ break;
+ case 2:
astman_send_ack(s, m, "Module Reloaded");
- } else {
- astman_send_error(s, m, s == 0 ? "No such module" : "Module does not support reload");
+ break;
+ default:
+ astman_send_error(s, m, "An unknown error occurred");
+ break;
}
return 0;
}
@@ -6107,7 +6119,7 @@
ast_md5_hash(resp_hash, resp);
}
- if (!d.nonce || strncasecmp(d.response, resp_hash, strlen(resp_hash))) {
+ if (strncasecmp(d.response, resp_hash, strlen(resp_hash))) {
/* Something was wrong, so give the client to try with a new challenge */
AST_RWLIST_UNLOCK(&users);
nonce = 0;
@@ -6815,7 +6827,7 @@
if (user_writetimeout) {
int value = atoi(user_writetimeout);
if (value < 100) {
- ast_log(LOG_WARNING, "Invalid writetimeout value '%s' at users.conf line %d\n", var->value, var->lineno);
+ ast_log(LOG_WARNING, "Invalid writetimeout value '%d' in users.conf\n", value);
} else {
user->writetimeout = value;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/netsock2.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 332559 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/config.h"
#include "asterisk/netsock2.h"
@@ -270,6 +270,10 @@
res_cnt++;
}
+ if (res_cnt == 0) {
+ goto cleanup;
+ }
+
if ((*addrs = ast_malloc(res_cnt * sizeof(struct ast_sockaddr))) == NULL) {
res_cnt = 0;
goto cleanup;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/pbx.c
^
|
@@ -24,7 +24,7 @@
*/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367469 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_SYSTEM_NAME */
@@ -1612,8 +1612,9 @@
extenstr[0] = '\0';
- if (node && node->exten)
+ if (node->exten) {
snprintf(extenstr, sizeof(extenstr), "(%p)", node->exten);
+ }
if (strlen(node->x) > 1) {
ast_cli(fd, "%s[%s]:%c:%c:%d:%s%s%s\n", prefix, node->x, node->is_pattern ? 'Y' : 'N',
@@ -5100,8 +5101,9 @@
* and continue, or we can drop out entirely. */
if (invalid
- || !ast_exists_extension(c, c->context, c->exten, 1,
- S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) {
+ || (ast_strlen_zero(dst_exten) &&
+ !ast_exists_extension(c, c->context, c->exten, 1,
+ S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL)))) {
/*!\note
* If there is no match at priority 1, it is not a valid extension anymore.
* Try to continue at "i" (for invalid) or "e" (for exception) or exit if
@@ -6540,8 +6542,10 @@
dpc->context_existence = 1;
- if (!c->pattern_tree)
+ if (!c->pattern_tree) {
+ /* Ignore check_return warning from Coverity for ast_exists_extension below */
ast_exists_extension(NULL, c->name, "s", 1, ""); /* do this to force the trie to built, if it is not already */
+ }
ast_rdlock_context(c);
@@ -7330,6 +7334,8 @@
if (!new) {
ast_log(LOG_ERROR,"Could not allocate a new context for %s in merge_and_delete! Danger!\n", context->name);
+ ast_hashtab_end_traversal(prio_iter);
+ ast_hashtab_end_traversal(exten_iter);
return; /* no sense continuing. */
}
/* we will not replace existing entries in the new context with stuff from the old context.
@@ -8055,6 +8061,7 @@
if (!strcasecmp(ignorepatc->pattern, value)) {
/* Already there */
ast_unlock_context(con);
+ ast_free(ignorepat);
errno = EEXIST;
return -1;
}
@@ -9531,6 +9538,11 @@
struct timeval tv = ast_tvnow();
long timesecs;
+ if (!chan) {
+ ast_log(LOG_WARNING, "GotoIfTime requires a channel on which to operate\n");
+ return -1;
+ }
+
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "GotoIfTime requires an argument:\n <time range>,<days of week>,<days of month>,<months>[,<timezone>]?'labeliftrue':'labeliffalse'\n");
return -1;
@@ -9538,17 +9550,16 @@
ts = s = ast_strdupa(data);
- if (chan) {
- ast_channel_lock(chan);
- if ((ctime = pbx_builtin_getvar_helper(chan, "TESTTIME")) && sscanf(ctime, "%ld", ×ecs) == 1) {
- tv.tv_sec = timesecs;
- } else if (ctime) {
- ast_log(LOG_WARNING, "Using current time to evaluate\n");
- /* Reset when unparseable */
- pbx_builtin_setvar_helper(chan, "TESTTIME", NULL);
- }
- ast_channel_unlock(chan);
+ ast_channel_lock(chan);
+ if ((ctime = pbx_builtin_getvar_helper(chan, "TESTTIME")) && sscanf(ctime, "%ld", ×ecs) == 1) {
+ tv.tv_sec = timesecs;
+ } else if (ctime) {
+ ast_log(LOG_WARNING, "Using current time to evaluate\n");
+ /* Reset when unparseable */
+ pbx_builtin_setvar_helper(chan, "TESTTIME", NULL);
}
+ ast_channel_unlock(chan);
+
/* Separate the Goto path */
strsep(&ts, "?");
branch1 = strsep(&ts,":");
@@ -9664,7 +9675,8 @@
if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) {
ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n");
} else if (ast_test_flag(&flags, WAITEXTEN_MOH)) {
- ast_indicate_data(chan, AST_CONTROL_HOLD, S_OR(opts[0], NULL), strlen(opts[0]));
+ ast_indicate_data(chan, AST_CONTROL_HOLD, S_OR(opts[0], NULL),
+ !ast_strlen_zero(opts[0]) ? strlen(opts[0]) + 1 : 0);
} else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE)) {
struct ast_tone_zone_sound *ts = ast_get_indication_tone(chan->zone, "dial");
if (ts) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/say.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 339352 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 367027 $")
#include <netinet/in.h>
#include <time.h>
@@ -6113,6 +6113,9 @@
if (tm.tm_hour < 10) {
res = wait_file(chan, ints, "digits/0", lang);
}
+ /* XXX Static analysis warns of no break here. No idea if this is
+ * correct or not
+ */
case 'k':
/* 24-Hour */
if (!(tm.tm_hour % 10) || tm.tm_hour < 10) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/tcptls.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370104 $")
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
@@ -242,10 +242,11 @@
return NULL;
}
- if (tcptls_session && tcptls_session->parent->worker_fn)
+ if (tcptls_session->parent->worker_fn) {
return tcptls_session->parent->worker_fn(tcptls_session);
- else
+ } else {
return tcptls_session;
+ }
}
void *ast_tcptls_server_root(void *data)
@@ -311,6 +312,14 @@
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
+ /* Get rid of an old SSL_CTX since we're about to
+ * allocate a new one
+ */
+ if (cfg->ssl_ctx) {
+ SSL_CTX_free(cfg->ssl_ctx);
+ cfg->ssl_ctx = NULL;
+ }
+
if (client) {
#ifndef OPENSSL_NO_SSL2
if (ast_test_flag(&cfg->flags, AST_SSL_SSLV2_CLIENT)) {
@@ -346,6 +355,8 @@
ast_verb(0, "SSL error loading cert file. <%s>", cfg->certfile);
sleep(2);
cfg->enabled = 0;
+ SSL_CTX_free(cfg->ssl_ctx);
+ cfg->ssl_ctx = NULL;
return 0;
}
}
@@ -355,6 +366,8 @@
ast_verb(0, "SSL error loading private key file. <%s>", tmpprivate);
sleep(2);
cfg->enabled = 0;
+ SSL_CTX_free(cfg->ssl_ctx);
+ cfg->ssl_ctx = NULL;
return 0;
}
}
@@ -365,6 +378,8 @@
ast_verb(0, "SSL cipher error <%s>", cfg->cipher);
sleep(2);
cfg->enabled = 0;
+ SSL_CTX_free(cfg->ssl_ctx);
+ cfg->ssl_ctx = NULL;
return 0;
}
}
@@ -384,6 +399,16 @@
return __ssl_setup(cfg, 0);
}
+void ast_ssl_teardown(struct ast_tls_config *cfg)
+{
+#ifdef DO_SSL
+ if (cfg->ssl_ctx) {
+ SSL_CTX_free(cfg->ssl_ctx);
+ cfg->ssl_ctx = NULL;
+ }
+#endif
+}
+
struct ast_tcptls_session_instance *ast_tcptls_client_start(struct ast_tcptls_session_instance *tcptls_session)
{
struct ast_tcptls_session_args *desc;
@@ -412,11 +437,11 @@
return handle_tcptls_connection(tcptls_session);
client_start_error:
- close(desc->accept_fd);
- desc->accept_fd = -1;
- if (tcptls_session) {
- ao2_ref(tcptls_session, -1);
+ if (desc) {
+ close(desc->accept_fd);
+ desc->accept_fd = -1;
}
+ ao2_ref(tcptls_session, -1);
return NULL;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/main/xmldoc.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h"
@@ -976,26 +976,28 @@
/* is this a recursive parameter. */
paramname = xmldoc_get_syntax_cmd(node, "", 0);
isenum = 1;
- } else if (!xmldoc_has_inside(node, "enumlist")) {
- /* this is a simple parameter. */
- attrname = ast_xml_get_attribute(node, "name");
- if (!attrname) {
- /* ignore this bogus parameter and continue. */
- continue;
- }
- paramname = ast_strdup(attrname);
- ast_xml_free_attr(attrname);
- isenum = 0;
} else {
- /* parse enumlist (note that this is a special enumlist
- that is used to describe a syntax like {<param1>|<param2>|...} */
for (tmpnode = ast_xml_node_get_children(node); tmpnode; tmpnode = ast_xml_node_get_next(tmpnode)) {
if (!strcasecmp(ast_xml_node_get_name(tmpnode), "enumlist")) {
break;
}
}
- paramname = xmldoc_parse_cmd_enumlist(tmpnode);
- isenum = 1;
+ if (tmpnode) {
+ /* parse enumlist (note that this is a special enumlist
+ that is used to describe a syntax like {<param1>|<param2>|...} */
+ paramname = xmldoc_parse_cmd_enumlist(tmpnode);
+ isenum = 1;
+ } else {
+ /* this is a simple parameter. */
+ attrname = ast_xml_get_attribute(node, "name");
+ if (!attrname) {
+ /* ignore this bogus parameter and continue. */
+ continue;
+ }
+ paramname = ast_strdup(attrname);
+ ast_xml_free_attr(attrname);
+ isenum = 0;
+ }
}
/* Is this parameter required? */
@@ -1664,6 +1666,7 @@
ast_str_append(buffer, 0, "\n");
ast_xml_free_attr(optname);
ast_xml_free_attr(hasparams);
+ ast_free(optionsyntax);
}
}
@@ -1715,7 +1718,11 @@
ast_xml_free_attr(paramname);
printed = 1;
}
- xmldoc_parse_para(node, internaltabs, "\n", buffer);
+ if (xmldoc_parse_para(node, internaltabs, "\n", buffer)) {
+ /* If anything ever goes in below this condition before the continue below,
+ * we should probably continue immediately. */
+ continue;
+ }
continue;
} else if ((xmldoc_parse_specialtags(node, internaltabs, "\n", buffer))) {
continue;
@@ -1734,12 +1741,14 @@
char *retstr = NULL;
if (ast_strlen_zero(type) || ast_strlen_zero(name)) {
+ ast_free(ret);
return NULL;
}
node = xmldoc_get_node(type, name, module, documentation_language);
if (!node || !ast_xml_node_get_children(node)) {
+ ast_free(ret);
return NULL;
}
@@ -1752,6 +1761,7 @@
if (!node || !ast_xml_node_get_children(node)) {
/* We couldn't find the syntax node. */
+ ast_free(ret);
return NULL;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/pbx/dundi-parser.c
^
|
@@ -24,7 +24,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 196072 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366409 $")
#include <sys/socket.h>
#include <netinet/in.h>
@@ -454,15 +454,7 @@
char subclass2[20];
char *subclass;
char tmp[256];
- char retries[20];
- if (ntohs(fhi->dtrans) & DUNDI_FLAG_RETRANS)
- strcpy(retries, "Yes");
- else
- strcpy(retries, "No");
- if ((ntohs(fhi->strans) & DUNDI_FLAG_RESERVED)) {
- /* Ignore frames with high bit set to 1 */
- return;
- }
+ const char *retries = "Yes";
if ((fhi->cmdresp & 0x3f) > (int)sizeof(commands)/(int)sizeof(char *)) {
snprintf(class2, (int)sizeof(class2), "(%d?)", fhi->cmdresp);
class = class2;
@@ -512,8 +504,10 @@
ied->buf[ied->pos++] = ie;
ied->buf[ied->pos++] = datalen;
ied->buf[ied->pos++] = cause;
- memcpy(ied->buf + ied->pos, data, datalen-1);
- ied->pos += datalen-1;
+ if (data) {
+ memcpy(ied->buf + ied->pos, data, datalen-1);
+ ied->pos += datalen-1;
+ }
return 0;
}
@@ -531,8 +525,10 @@
flags = htons(flags);
memcpy(ied->buf + ied->pos, &flags, sizeof(flags));
ied->pos += 2;
- memcpy(ied->buf + ied->pos, data, datalen-1);
- ied->pos += datalen-2;
+ if (data) {
+ memcpy(ied->buf + ied->pos, data, datalen-2);
+ ied->pos += datalen-2;
+ }
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/pbx/pbx_config.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 355009 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <ctype.h>
@@ -733,6 +733,11 @@
snprintf(filename, sizeof(filename), "%s%s%s", base, slash, config);
cfg = ast_config_load("extensions.conf", config_flags);
+ if (!cfg) {
+ ast_cli(a->fd, "Failed to load extensions.conf\n");
+ ast_mutex_unlock(&save_dialplan_lock);
+ return CLI_FAILURE;
+ }
/* try to lock contexts list */
if (ast_rdlock_contexts()) {
@@ -1351,8 +1356,13 @@
static char *pbx_strsep(char **destructible, const char *delim)
{
int square = 0;
- char *res = *destructible;
- for (; destructible && *destructible && **destructible; (*destructible)++) {
+ char *res;
+
+ if (!destructible || !*destructible) {
+ return NULL;
+ }
+ res = *destructible;
+ for (; **destructible; (*destructible)++) {
if (**destructible == '[' && !strchr(delim, '[')) {
square++;
} else if (**destructible == ']' && !strchr(delim, ']')) {
@@ -1367,7 +1377,7 @@
break;
}
}
- if (destructible && *destructible && **destructible == '\0') {
+ if (**destructible == '\0') {
*destructible = NULL;
}
return res;
@@ -1577,7 +1587,7 @@
v->lineno, vfile);
}
}
- free(tc);
+ ast_free(tc);
} else if (!strcasecmp(v->name, "include")) {
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
if (ast_context_add_include2(con, realvalue, registrar)) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/pbx/pbx_dundi.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include "asterisk/network.h"
#include <sys/ioctl.h>
@@ -1014,7 +1014,7 @@
totallen += (ies->eidcount - skipfirst) * sizeof(dundi_eid);
st = ast_calloc(1, totallen);
if (st) {
- ast_copy_string(st->called_context, ies->called_context, sizeof(st->called_context));
+ ast_copy_string(st->called_context, dr.dcontext, sizeof(st->called_context));
ast_copy_string(st->called_number, ies->called_number, sizeof(st->called_number));
st->trans = trans;
st->ttl = ies->ttl - 1;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/ael/ael.flex
^
|
@@ -69,7 +69,7 @@
%{
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 272260 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366094 $")
#include <sys/types.h>
#include <sys/stat.h>
@@ -805,7 +805,9 @@
if (my_file)
free(my_file);
my_file = strdup(filename);
- stat(filename, &stats);
+ if (stat(filename, &stats)) {
+ ast_log(LOG_WARNING, "failed to populate stats from file '%s'\n", filename);
+ }
buffer = (char*)malloc(stats.st_size+2);
if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
@@ -875,7 +877,9 @@
} else {
char *buffer;
struct stat stats;
- stat(fnamebuf2, &stats);
+ if (stat(fnamebuf2, &stats)) {
+ ast_log(LOG_WARNING, "Failed to populate stats from file '%s'\n", fnamebuf2);
+ }
buffer = (char*)malloc(stats.st_size+1);
if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/ael/pval.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358810 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include <sys/types.h>
#include <stdlib.h>
@@ -1160,7 +1160,11 @@
pval *curr_ext = get_extension_or_contxt(item); /* containing exten, or macro */
pval *curr_cont;
- if (item->u1.list && !item->u1.list->next && !strstr((item->u1.list)->u1.str,"${")) {
+ if (!item->u1.list) {
+ return NULL;
+ }
+
+ if (!item->u1.list->next && !strstr((item->u1.list)->u1.str,"${")) {
struct pval *x = find_label_in_current_extension((char*)((item->u1.list)->u1.str), curr_ext);
return x;
}
@@ -1219,21 +1223,24 @@
return x;
}
}
- return 0;
+ return NULL;
}
static void check_goto(pval *item)
{
+ if (!item->u1.list) {
+ return;
+ }
+
/* check for the target of the goto-- does it exist? */
if ( !(item->u1.list)->next && !(item->u1.list)->u1.str ) {
ast_log(LOG_ERROR,"Error: file %s, line %d-%d: goto: empty label reference found!\n",
item->filename, item->startline, item->endline);
errs++;
}
-
+
/* just one item-- the label should be in the current extension */
-
- if (item->u1.list && !item->u1.list->next && !strstr((item->u1.list)->u1.str,"${")) {
+ if (!item->u1.list->next && !strstr(item->u1.list->u1.str,"${")) {
struct pval *z = get_extension_or_contxt(item);
struct pval *x = 0;
if (z)
@@ -5882,7 +5889,7 @@
{
if (!pvalCheckType(p, "pvalGlobalsWalkStatements", PV_GLOBALS))
return 0;
- if (!next_statement) {
+ if (!*next_statement) {
*next_statement = p;
return p;
} else {
@@ -5903,7 +5910,7 @@
pval *pvalTopLevWalkObjects(pval *p, pval **next_obj )
{
- if (!next_obj) {
+ if (!*next_obj) {
*next_obj = p;
return p;
} else {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_agi.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362362 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365460 $")
#include <math.h>
#include <signal.h>
@@ -3619,6 +3619,7 @@
" When called with a topic as an argument, displays usage\n"
" information on the given command. If called without a\n"
" topic, it provides a list of AGI commands.\n";
+ return NULL;
case CLI_GENERATE:
return NULL;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_calendar.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 356291 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include "asterisk/_private.h"
#include "asterisk/calendar.h"
@@ -358,6 +358,7 @@
static enum ast_device_state calendarstate(const char *data)
{
+ enum ast_device_state state;
struct ast_calendar *cal;
if (ast_strlen_zero(data) || (!(cal = find_calendar(data)))) {
@@ -365,10 +366,13 @@
}
if (cal->tech->is_busy) {
- return cal->tech->is_busy(cal) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE;
+ state = cal->tech->is_busy(cal) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE;
+ } else {
+ state = calendar_is_busy(cal) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE;
}
- return calendar_is_busy(cal) ? AST_DEVICE_INUSE : AST_DEVICE_NOT_INUSE;
+ cal = unref_calendar(cal);
+ return state;
}
static struct ast_calendar *build_calendar(struct ast_config *cfg, const char *cat, const struct ast_calendar_tech *tech)
@@ -1007,6 +1011,7 @@
}
strcpy(buf, calendar_is_busy(cal) ? "1" : "0");
+ cal = unref_calendar(cal);
return 0;
}
@@ -1161,6 +1166,8 @@
ast_debug(10, "%s (%ld - %ld) overlapped with (%ld - %ld)\n", event->summary, (long) event->start, (long) event->end, (long) start, (long) end);
if (add_event_to_list(events, event, start, end) < 0) {
event = ast_calendar_unref_event(event);
+ cal = unref_calendar(cal);
+ ao2_ref(events, -1);
ao2_iterator_destroy(&i);
return -1;
}
@@ -1178,6 +1185,8 @@
if (!(eventlist_datastore = ast_datastore_alloc(&eventlist_datastore_info, buf))) {
ast_log(LOG_ERROR, "Could not allocate datastore!\n");
+ cal = unref_calendar(cal);
+ ao2_ref(events, -1);
return -1;
}
@@ -1188,6 +1197,7 @@
ast_channel_datastore_add(chan, eventlist_datastore);
ast_channel_unlock(chan);
+ cal = unref_calendar(cal);
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_calendar_caldav.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <libical/ical.h>
#include <ne_session.h>
@@ -181,9 +181,8 @@
return -1;
}
if (!(body = ast_str_create(512)) ||
- !(subdir = ast_str_create(32)) ||
- !(response = ast_str_create(512))) {
- ast_log(LOG_ERROR, "Could not allocate memory for request and response!\n");
+ !(subdir = ast_str_create(32))) {
+ ast_log(LOG_ERROR, "Could not allocate memory for request!\n");
goto write_cleanup;
}
@@ -406,10 +405,12 @@
return;
}
data = icalproperty_get_attendee(prop);
- if (!ast_strlen_zero(data)) {
- attendee->data = ast_strdup(data);;
- AST_LIST_INSERT_TAIL(&event->attendees, attendee, next);
+ if (ast_strlen_zero(data)) {
+ ast_free(attendee);
+ continue;
}
+ attendee->data = ast_strdup(data);
+ AST_LIST_INSERT_TAIL(&event->attendees, attendee, next);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_calendar_ews.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361606 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366740 $")
#include <ne_request.h>
#include <ne_session.h>
@@ -233,7 +233,7 @@
/* Event UID */
if (ctx->op == XML_OP_FIND) {
struct calendar_id *id;
- if (!(id = ast_calloc(1, sizeof(id)))) {
+ if (!(id = ast_calloc(1, sizeof(*id)))) {
return NE_XML_ABORT;
}
if (!(id->id = ast_str_create(256))) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_calendar_exchange.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <libical/ical.h>
#include <ne_session.h>
@@ -433,9 +433,8 @@
return -1;
}
if (!(body = ast_str_create(512)) ||
- !(subdir = ast_str_create(32)) ||
- !(response = ast_str_create(512))) {
- ast_log(LOG_ERROR, "Could not allocate memory for request and response!\n");
+ !(subdir = ast_str_create(32))) {
+ ast_log(LOG_ERROR, "Could not allocate memory for request!\n");
goto write_cleanup;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_calendar_icalendar.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <libical/ical.h>
#include <ne_session.h>
@@ -133,6 +133,7 @@
if (!pvt) {
ast_log(LOG_ERROR, "There is no private!\n");
+ return NULL;
}
if (!(response = ast_str_create(512))) {
@@ -260,10 +261,12 @@
return;
}
data = icalproperty_get_attendee(prop);
- if (!ast_strlen_zero(data)) {
- attendee->data = ast_strdup(data);;
- AST_LIST_INSERT_TAIL(&event->attendees, attendee, next);
+ if (ast_strlen_zero(data)) {
+ ast_free(attendee);
+ continue;
}
+ attendee->data = ast_strdup(data);;
+ AST_LIST_INSERT_TAIL(&event->attendees, attendee, next);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_config_odbc.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362354 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 368039 $")
#include "asterisk/file.h"
#include "asterisk/channel.h"
@@ -317,7 +317,7 @@
char sql[1024];
char coltitle[256];
char rowdata[2048];
- const char *initfield=NULL;
+ const char *initfield;
char *op;
const char *newparam;
char *stringp;
@@ -375,9 +375,7 @@
}
va_end(aq);
- if (initfield) {
- snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield);
- }
+ snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield);
va_copy(cps.ap, ap);
stmt = ast_odbc_prepare_and_execute(obj, custom_prepare, &cps);
@@ -447,7 +445,7 @@
if (strchr(chunk, '^')) {
decode_chunk(chunk);
}
- if (initfield && !strcmp(initfield, coltitle)) {
+ if (!strcmp(initfield, coltitle)) {
ast_category_rename(cat, chunk);
}
var = ast_variable_new(coltitle, chunk, "");
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_jabber.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 346086 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <ctype.h>
#include <iksemel.h>
@@ -2252,6 +2252,7 @@
/* insert will furtherly be added to message list */
insert->from = ast_strdup(pak->from->full);
if (!insert->from) {
+ ast_free(insert);
ast_log(LOG_ERROR, "Memory allocation failure\n");
return;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_monitor.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 355574 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include <sys/stat.h>
#include <libgen.h>
@@ -378,7 +378,9 @@
O_CREAT|O_TRUNC|O_WRONLY, 0, AST_FILE_MODE))) {
ast_log(LOG_WARNING, "Could not create file %s\n",
monitor->write_filename);
- ast_closestream(monitor->read_stream);
+ if (monitor->read_stream) {
+ ast_closestream(monitor->read_stream);
+ }
ast_free(monitor);
UNLOCK_IF_NEEDED(chan, need_lock);
return -1;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_musiconhold.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362362 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <ctype.h>
#include <signal.h>
@@ -1065,10 +1065,12 @@
class->total_files = 0;
if (!getcwd(path, sizeof(path))) {
ast_log(LOG_WARNING, "getcwd() failed: %s\n", strerror(errno));
+ closedir(files_DIR);
return -1;
}
if (chdir(dir_path) < 0) {
ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno));
+ closedir(files_DIR);
return -1;
}
while ((files_dirent = readdir(files_DIR))) {
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_odbc.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 356917 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366167 $")
#include "asterisk/file.h"
#include "asterisk/channel.h"
@@ -365,6 +365,10 @@
chan = tx->owner;
}
+ if (!chan) {
+ return -1;
+ }
+
ast_channel_lock(chan);
if (!(txn_store = ast_channel_datastore_find(chan, &txn_info, NULL))) {
ast_channel_unlock(chan);
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_rtp_asterisk.c
^
|
@@ -34,7 +34,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 362362 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <sys/time.h>
#include <signal.h>
@@ -566,6 +566,8 @@
/* See if we ran out of ports or if the bind actually failed because of something other than the address being in use */
if (x == startplace || errno != EADDRINUSE) {
ast_log(LOG_ERROR, "Oh dear... we couldn't allocate a port for RTP instance '%p'\n", instance);
+ close(rtp->s);
+ ast_free(rtp);
return -1;
}
}
@@ -1933,7 +1935,7 @@
ast_verbose(" Fraction lost: %ld\n", (((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24));
ast_verbose(" Packets lost so far: %d\n", rtp->rtcp->reported_lost);
ast_verbose(" Highest sequence number: %ld\n", (long) (ntohl(rtcpheader[i + 2]) & 0xffff));
- ast_verbose(" Sequence number cycles: %ld\n", (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16);
+ ast_verbose(" Sequence number cycles: %ld\n", (long) (ntohl(rtcpheader[i + 2])) >> 16);
ast_verbose(" Interarrival jitter: %u\n", rtp->rtcp->reported_jitter);
ast_verbose(" Last SR(our NTP): %lu.%010lu\n",(unsigned long) ntohl(rtcpheader[i + 4]) >> 16,((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096);
ast_verbose(" DLSR: %4.4f (sec)\n",ntohl(rtcpheader[i + 5])/65536.0);
@@ -1960,7 +1962,7 @@
(((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24),
rtp->rtcp->reported_lost,
(long) (ntohl(rtcpheader[i + 2]) & 0xffff),
- (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16,
+ (long) (ntohl(rtcpheader[i + 2])) >> 16,
rtp->rtcp->reported_jitter,
(unsigned long) ntohl(rtcpheader[i + 4]) >> 16, ((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096,
ntohl(rtcpheader[i + 5])/65536.0,
@@ -1984,7 +1986,7 @@
(((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24),
rtp->rtcp->reported_lost,
(long) (ntohl(rtcpheader[i + 2]) & 0xffff),
- (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16,
+ (long) (ntohl(rtcpheader[i + 2])) >> 16,
rtp->rtcp->reported_jitter,
(unsigned long) ntohl(rtcpheader[i + 4]) >> 16,
((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096,
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_speech.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $");
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 365460 $");
#include "asterisk/channel.h"
#include "asterisk/module.h"
@@ -250,15 +250,13 @@
{
int res = 0;
- switch (state) {
- case AST_SPEECH_STATE_WAIT:
+ if (state == AST_SPEECH_STATE_WAIT) {
/* The engine heard audio, so they spoke */
ast_set_flag(speech, AST_SPEECH_SPOKE);
- default:
- speech->state = state;
- break;
}
+ speech->state = state;
+
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/res/res_srtp.c
^
|
@@ -37,7 +37,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
#include <srtp/srtp.h>
@@ -433,12 +433,14 @@
if (!(temp = res_srtp_new())) {
return -1;
}
+ ast_module_ref(ast_module_info->self);
+ /* Any failures after this point can use ast_srtp_destroy to destroy the instance */
if (srtp_create(&temp->session, &policy->sp) != err_status_ok) {
+ ast_srtp_destroy(temp);
return -1;
}
- ast_module_ref(ast_module_info->self);
temp->rtp = rtp;
*srtp = temp;
|
[-]
[+]
|
Changed |
asterisk-1.8.14.1.tar.xz/tests/test_config.c
^
|
@@ -59,19 +59,22 @@
ret = AST_TEST_FAIL; \
} else { \
if (((flags) & PARSE_TYPE) == PARSE_INT32) { \
- int32_t *r = (int32_t *) result, e = (int32_t) expected_result; \
+ int32_t *r = (int32_t *) (void *) result; \
+ int32_t e = (int32_t) expected_result; \
if (*r != e) { \
ast_test_status_update(test, "ast_parse_arg int32_t failed with %d != %d\n", *r, e); \
ret = AST_TEST_FAIL; \
} \
} else if (((flags) & PARSE_TYPE) == PARSE_UINT32) { \
- uint32_t *r = (uint32_t *) result, e = (uint32_t) expected_result; \
+ uint32_t *r = (uint32_t *) (void *) result; \
+ uint32_t e = (uint32_t) expected_result; \
if (*r != e) { \
ast_test_status_update(test, "ast_parse_arg uint32_t failed with %u != %u\n", *r, e); \
ret = AST_TEST_FAIL; \
} \
} else if (((flags) & PARSE_TYPE) == PARSE_DOUBLE) { \
- double *r = (double *) result, e = (double) expected_result; \
+ double *r = (double *) (void *) result; \
+ double e = (double) expected_result; \
if (fabs(*r - e) > EPSILON) { \
ast_test_status_update(test, "ast_parse_arg double failed with %f != %f\n", *r, e); \
ret = AST_TEST_FAIL; \
|