mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 20:38:59 +00:00
Compare commits
10 Commits
1.8.26.0-r
...
1.8.21.0-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d54395bb96 | ||
|
|
137fa01ae5 | ||
|
|
3d9f9edaa8 | ||
|
|
2387b63233 | ||
|
|
e6f0c67991 | ||
|
|
e00fcd62dd | ||
|
|
3fe7a6c992 | ||
|
|
21ae3d8e61 | ||
|
|
5cf8a20545 | ||
|
|
365dbcf175 |
1
.lastclean
Normal file
1
.lastclean
Normal file
@@ -0,0 +1 @@
|
||||
40
|
||||
68
asterisk-1.8.21.0-rc2-summary.html
Normal file
68
asterisk-1.8.21.0-rc2-summary.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!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.21.0-rc2</title></head>
|
||||
<body>
|
||||
<h1 align="center"><a name="top">Release Summary</a></h1>
|
||||
<h3 align="center">asterisk-1.8.21.0-rc2</h3>
|
||||
<h3 align="center">Date: 2013-03-27</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.21.0-rc1.</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>
|
||||
5 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=383966">383966</a></td><td>bebuild</td><td>Create 1.8.21.0-rc2</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=383969">383969</a></td><td>bebuild</td><td>Update version, remove summaries, merge blockers</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=383972">383972</a></td><td>bebuild</td><td>Merge r383863 for ASTERISK-21068</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=384086">384086</a></td><td>bebuild</td><td>Update with security patches; regression fixes</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=384089">384089</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 | 93 +++++
|
||||
asterisk-1.8.21.0-rc1-summary.html | 465 -----------------------------
|
||||
asterisk-1.8.21.0-rc1-summary.txt | 576 -------------------------------------
|
||||
channels/chan_sip.c | 135 +++++---
|
||||
channels/sip/include/sip.h | 1
|
||||
main/cdr.c | 24 +
|
||||
main/http.c | 9
|
||||
main/rtp_engine.c | 13
|
||||
res/res_rtp_asterisk.c | 2
|
||||
10 files changed, 229 insertions(+), 1091 deletions(-)
|
||||
</pre><br/>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
||||
102
asterisk-1.8.21.0-rc2-summary.txt
Normal file
102
asterisk-1.8.21.0-rc2-summary.txt
Normal file
@@ -0,0 +1,102 @@
|
||||
Release Summary
|
||||
|
||||
asterisk-1.8.21.0-rc2
|
||||
|
||||
Date: 2013-03-27
|
||||
|
||||
<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.21.0-rc1.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
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
|
||||
5 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 |
|
||||
|----------+---------+-------------------------------+-------------------|
|
||||
| 383966 | bebuild | Create 1.8.21.0-rc2 | |
|
||||
|----------+---------+-------------------------------+-------------------|
|
||||
| 383969 | bebuild | Update version, remove | |
|
||||
| | | summaries, merge blockers | |
|
||||
|----------+---------+-------------------------------+-------------------|
|
||||
| 383972 | bebuild | Merge r383863 for | |
|
||||
| | | ASTERISK-21068 | |
|
||||
|----------+---------+-------------------------------+-------------------|
|
||||
| 384086 | bebuild | Update with security patches; | |
|
||||
| | | regression fixes | |
|
||||
|----------+---------+-------------------------------+-------------------|
|
||||
| 384089 | 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 | 93 +++++
|
||||
asterisk-1.8.21.0-rc1-summary.html | 465 -----------------------------
|
||||
asterisk-1.8.21.0-rc1-summary.txt | 576 -------------------------------------
|
||||
channels/chan_sip.c | 135 +++++---
|
||||
channels/sip/include/sip.h | 1
|
||||
main/cdr.c | 24 +
|
||||
main/http.c | 9
|
||||
main/rtp_engine.c | 13
|
||||
res/res_rtp_asterisk.c | 2
|
||||
10 files changed, 229 insertions(+), 1091 deletions(-)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -1110,6 +1110,11 @@ static struct ao2_container *threadt;
|
||||
static struct ao2_container *peers;
|
||||
static struct ao2_container *peers_by_ip;
|
||||
|
||||
/*! \brief A bogus peer, to be used when authentication should fail */
|
||||
static struct sip_peer *bogus_peer;
|
||||
/*! \brief We can recognise the bogus peer by this invalid MD5 hash */
|
||||
#define BOGUS_PEER_MD5SECRET "intentionally_invalid_md5_string"
|
||||
|
||||
/*! \brief The register list: Other SIP proxies we register with and receive calls from */
|
||||
static struct ast_register_list {
|
||||
ASTOBJ_CONTAINER_COMPONENTS(struct sip_registry);
|
||||
@@ -1250,7 +1255,7 @@ static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg
|
||||
static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
|
||||
static int transmit_provisional_response(struct sip_pvt *p, const char *msg, const struct sip_request *req, int with_sdp);
|
||||
static int transmit_response_with_allow(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
|
||||
static void transmit_fake_auth_response(struct sip_pvt *p, int sipmethod, struct sip_request *req, enum xmittype reliable);
|
||||
static void transmit_fake_auth_response(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable);
|
||||
static int transmit_request(struct sip_pvt *p, int sipmethod, uint32_t seqno, enum xmittype reliable, int newbranch);
|
||||
static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, uint32_t seqno, enum xmittype reliable, int newbranch);
|
||||
static int transmit_publish(struct sip_epa_entry *epa_entry, enum sip_publish_type publish_type, const char * const explicit_uri);
|
||||
@@ -14667,7 +14672,9 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Registered SIP '%s' at %s\n", peer->name,
|
||||
ast_sockaddr_stringify(&peer->addr));
|
||||
}
|
||||
sip_pvt_unlock(pvt);
|
||||
sip_poke_peer(peer, 0);
|
||||
sip_pvt_lock(pvt);
|
||||
register_peer_exten(peer, 1);
|
||||
|
||||
/* Save User agent */
|
||||
@@ -14854,6 +14861,7 @@ static enum check_auth_result check_auth(struct sip_pvt *p, struct sip_request *
|
||||
char a1_hash[256];
|
||||
char resp_hash[256]="";
|
||||
char *c;
|
||||
int is_bogus_peer = 0;
|
||||
int wrongnonce = FALSE;
|
||||
int good_response;
|
||||
const char *usednonce = p->randdata;
|
||||
@@ -14948,8 +14956,14 @@ static enum check_auth_result check_auth(struct sip_pvt *p, struct sip_request *
|
||||
}
|
||||
}
|
||||
|
||||
/* We cannot rely on the bogus_peer having a bad md5 value. Someone could
|
||||
* use it to construct valid auth. */
|
||||
if (md5secret && strcmp(md5secret, BOGUS_PEER_MD5SECRET) == 0) {
|
||||
is_bogus_peer = 1;
|
||||
}
|
||||
|
||||
/* Verify that digest username matches the username we auth as */
|
||||
if (strcmp(username, keys[K_USER].s)) {
|
||||
if (strcmp(username, keys[K_USER].s) && !is_bogus_peer) {
|
||||
ast_log(LOG_WARNING, "username mismatch, have <%s>, digest has <%s>\n",
|
||||
username, keys[K_USER].s);
|
||||
/* Oops, we're trying something here */
|
||||
@@ -14988,7 +15002,8 @@ static enum check_auth_result check_auth(struct sip_pvt *p, struct sip_request *
|
||||
}
|
||||
|
||||
good_response = keys[K_RESP].s &&
|
||||
!strncasecmp(keys[K_RESP].s, resp_hash, strlen(resp_hash));
|
||||
!strncasecmp(keys[K_RESP].s, resp_hash, strlen(resp_hash)) &&
|
||||
!is_bogus_peer; /* lastly, check that the peer isn't the fake peer */
|
||||
if (wrongnonce) {
|
||||
if (good_response) {
|
||||
if (sipdebug)
|
||||
@@ -15132,7 +15147,7 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
|
||||
/*! \brief Send a fake 401 Unauthorized response when the administrator
|
||||
wants to hide the names of local devices from fishers
|
||||
*/
|
||||
static void transmit_fake_auth_response(struct sip_pvt *p, int sipmethod, struct sip_request *req, enum xmittype reliable)
|
||||
static void transmit_fake_auth_response(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable)
|
||||
{
|
||||
/* We have to emulate EXACTLY what we'd get with a good peer
|
||||
* and a bad password, or else we leak information. */
|
||||
@@ -15171,13 +15186,13 @@ static void transmit_fake_auth_response(struct sip_pvt *p, int sipmethod, struct
|
||||
}
|
||||
|
||||
if (!(buf = ast_str_thread_get(&check_auth_buf, CHECK_AUTH_BUF_INITLEN))) {
|
||||
transmit_response(p, "403 Forbidden (Bad auth)", &p->initreq);
|
||||
__transmit_response(p, "403 Forbidden", &p->initreq, reliable);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make a copy of the response and parse it */
|
||||
if (ast_str_set(&buf, 0, "%s", authtoken) == AST_DYNSTR_BUILD_FAILED) {
|
||||
transmit_response(p, "403 Forbidden (Bad auth)", &p->initreq);
|
||||
__transmit_response(p, "403 Forbidden", &p->initreq, reliable);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15215,7 +15230,7 @@ static void transmit_fake_auth_response(struct sip_pvt *p, int sipmethod, struct
|
||||
/* Schedule auto destroy in 32 seconds */
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
} else {
|
||||
transmit_response(p, "403 Forbidden (Bad auth)", &p->initreq);
|
||||
__transmit_response(p, "403 Forbidden", &p->initreq, reliable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15325,7 +15340,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
if (!AST_LIST_EMPTY(&domain_list)) {
|
||||
if (!check_sip_domain(domain, NULL, 0)) {
|
||||
if (sip_cfg.alwaysauthreject) {
|
||||
transmit_fake_auth_response(p, SIP_REGISTER, &p->initreq, XMIT_UNRELIABLE);
|
||||
transmit_fake_auth_response(p, &p->initreq, XMIT_UNRELIABLE);
|
||||
} else {
|
||||
transmit_response(p, "404 Not found (unknown domain)", &p->initreq);
|
||||
}
|
||||
@@ -15352,6 +15367,13 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
}
|
||||
peer = find_peer(name, NULL, TRUE, FINDPEERS, FALSE, 0);
|
||||
|
||||
/* If we don't want username disclosure, use the bogus_peer when a user
|
||||
* is not found. */
|
||||
if (!peer && sip_cfg.alwaysauthreject && !sip_cfg.autocreatepeer) {
|
||||
peer = bogus_peer;
|
||||
ref_peer(peer, "register_verify: ref the bogus_peer");
|
||||
}
|
||||
|
||||
if (!(peer && ast_apply_ha(peer->ha, addr))) {
|
||||
/* Peer fails ACL check */
|
||||
if (peer) {
|
||||
@@ -15427,7 +15449,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
switch (parse_register_contact(p, peer, req)) {
|
||||
case PARSE_REGISTER_DENIED:
|
||||
ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
|
||||
transmit_response_with_date(p, "403 Forbidden (ACL)", req);
|
||||
transmit_response_with_date(p, "403 Forbidden", req);
|
||||
res = 0;
|
||||
break;
|
||||
case PARSE_REGISTER_FAILED:
|
||||
@@ -15455,7 +15477,9 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
}
|
||||
if (!res) {
|
||||
if (send_mwi) {
|
||||
sip_pvt_unlock(p);
|
||||
sip_send_mwi_to_peer(peer, 0);
|
||||
sip_pvt_lock(p);
|
||||
} else {
|
||||
update_peer_lastmsgssent(peer, -1, 0);
|
||||
}
|
||||
@@ -15465,7 +15489,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
switch (res) {
|
||||
case AUTH_SECRET_FAILED:
|
||||
/* Wrong password in authentication. Go away, don't try again until you fixed it */
|
||||
transmit_response(p, "403 Forbidden (Bad auth)", &p->initreq);
|
||||
transmit_response(p, "403 Forbidden", &p->initreq);
|
||||
if (global_authfailureevents) {
|
||||
const char *peer_addr = ast_strdupa(ast_sockaddr_stringify_addr(addr));
|
||||
const char *peer_port = ast_strdupa(ast_sockaddr_stringify_port(addr));
|
||||
@@ -15488,7 +15512,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
|
||||
case AUTH_PEER_NOT_DYNAMIC:
|
||||
case AUTH_ACL_FAILED:
|
||||
if (sip_cfg.alwaysauthreject) {
|
||||
transmit_fake_auth_response(p, SIP_REGISTER, &p->initreq, XMIT_UNRELIABLE);
|
||||
transmit_fake_auth_response(p, &p->initreq, XMIT_UNRELIABLE);
|
||||
if (global_authfailureevents) {
|
||||
const char *peer_addr = ast_strdupa(ast_sockaddr_stringify_addr(addr));
|
||||
const char *peer_port = ast_strdupa(ast_sockaddr_stringify_port(addr));
|
||||
@@ -16495,7 +16519,19 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
|
||||
ast_verbose("No matching peer for '%s' from '%s'\n",
|
||||
of, ast_sockaddr_stringify(&p->recv));
|
||||
}
|
||||
return AUTH_DONT_KNOW;
|
||||
|
||||
/* If you don't mind, we can return 404s for devices that do
|
||||
* not exist: username disclosure. If we allow guests, there
|
||||
* is no way around that. */
|
||||
if (sip_cfg.allowguest || !sip_cfg.alwaysauthreject) {
|
||||
return AUTH_DONT_KNOW;
|
||||
}
|
||||
|
||||
/* If you do mind, we use a peer that will never authenticate.
|
||||
* This ensures that we follow the same code path as regular
|
||||
* auth: less chance for username disclosure. */
|
||||
peer = bogus_peer;
|
||||
ref_peer(peer, "ref_peer: check_peer_ok: must ref bogus_peer so unreffing it does not fail");
|
||||
}
|
||||
|
||||
if (!ast_apply_ha(peer->ha, addr)) {
|
||||
@@ -16503,9 +16539,10 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
|
||||
unref_peer(peer, "unref_peer: check_peer_ok: from find_peer call, early return of AUTH_ACL_FAILED");
|
||||
return AUTH_ACL_FAILED;
|
||||
}
|
||||
if (debug)
|
||||
if (debug && peer != bogus_peer) {
|
||||
ast_verbose("Found peer '%s' for '%s' from %s\n",
|
||||
peer->name, of, ast_sockaddr_stringify(&p->recv));
|
||||
}
|
||||
|
||||
/* XXX what about p->prefs = peer->prefs; ? */
|
||||
/* Set Frame packetization */
|
||||
@@ -16774,8 +16811,6 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
|
||||
} else {
|
||||
res = AUTH_RTP_FAILED;
|
||||
}
|
||||
} else if (sip_cfg.alwaysauthreject) {
|
||||
res = AUTH_FAKE_AUTH; /* reject with fake authorization request */
|
||||
} else {
|
||||
res = AUTH_SECRET_FAILED; /* we don't want any guests, authentication will fail */
|
||||
}
|
||||
@@ -22555,13 +22590,8 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req, st
|
||||
return 0;
|
||||
}
|
||||
if (res < 0) { /* Something failed in authentication */
|
||||
if (res == AUTH_FAKE_AUTH) {
|
||||
ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
|
||||
transmit_fake_auth_response(p, SIP_OPTIONS, req, XMIT_UNRELIABLE);
|
||||
} else {
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response(p, "403 Forbidden", req);
|
||||
}
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response(p, "403 Forbidden", req);
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
return 0;
|
||||
}
|
||||
@@ -23220,13 +23250,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
|
||||
goto request_invite_cleanup;
|
||||
}
|
||||
if (res < 0) { /* Something failed in authentication */
|
||||
if (res == AUTH_FAKE_AUTH) {
|
||||
ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
|
||||
transmit_fake_auth_response(p, SIP_INVITE, req, XMIT_RELIABLE);
|
||||
} else {
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response_reliable(p, "403 Forbidden", req);
|
||||
}
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response_reliable(p, "403 Forbidden", req);
|
||||
p->invitestate = INV_COMPLETED;
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
res = 0;
|
||||
@@ -25048,18 +25073,13 @@ static int handle_request_publish(struct sip_pvt *p, struct sip_request *req, st
|
||||
return -1;
|
||||
}
|
||||
|
||||
auth_result = check_user(p, req, SIP_PUBLISH, uri, XMIT_RELIABLE, addr);
|
||||
auth_result = check_user(p, req, SIP_PUBLISH, uri, XMIT_UNRELIABLE, addr);
|
||||
if (auth_result == AUTH_CHALLENGE_SENT) {
|
||||
p->lastinvite = seqno;
|
||||
return 0;
|
||||
} else if (auth_result < 0) {
|
||||
if (auth_result == AUTH_FAKE_AUTH) {
|
||||
ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
|
||||
transmit_fake_auth_response(p, SIP_INVITE, req, XMIT_RELIABLE);
|
||||
} else {
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response_reliable(p, "403 Forbidden", req);
|
||||
}
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response(p, "403 Forbidden", req);
|
||||
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
||||
ast_string_field_set(p, theirtag, NULL);
|
||||
return 0;
|
||||
@@ -25272,19 +25292,14 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
|
||||
* use if !req->ignore, because then we'll end up sending
|
||||
* a 200 OK if someone retransmits without sending auth */
|
||||
if (p->subscribed == NONE || resubscribe) {
|
||||
res = check_user_full(p, req, SIP_SUBSCRIBE, e, 0, addr, &authpeer);
|
||||
res = check_user_full(p, req, SIP_SUBSCRIBE, e, XMIT_UNRELIABLE, addr, &authpeer);
|
||||
|
||||
/* if an authentication response was sent, we are done here */
|
||||
if (res == AUTH_CHALLENGE_SENT) /* authpeer = NULL here */
|
||||
return 0;
|
||||
if (res != AUTH_SUCCESSFUL) {
|
||||
if (res == AUTH_FAKE_AUTH) {
|
||||
ast_log(LOG_NOTICE, "Sending fake auth rejection for device %s\n", get_header(req, "From"));
|
||||
transmit_fake_auth_response(p, SIP_SUBSCRIBE, req, XMIT_UNRELIABLE);
|
||||
} else {
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE\n", get_header(req, "From"));
|
||||
transmit_response_reliable(p, "403 Forbidden", req);
|
||||
}
|
||||
ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", get_header(req, "From"));
|
||||
transmit_response(p, "403 Forbidden", req);
|
||||
|
||||
pvt_set_needdestroy(p, "authentication failed");
|
||||
return 0;
|
||||
@@ -26932,6 +26947,9 @@ static int sip_poke_noanswer(const void *data)
|
||||
\note This is done with 60 seconds between each ping,
|
||||
unless forced by cli or manager. If peer is unreachable,
|
||||
we check every 10th second by default.
|
||||
\note Do *not* hold a pvt lock while calling this function.
|
||||
This function calls sip_alloc, which can cause a deadlock
|
||||
if another sip_pvt is held.
|
||||
*/
|
||||
static int sip_poke_peer(struct sip_peer *peer, int force)
|
||||
{
|
||||
@@ -30417,6 +30435,7 @@ static int sip_do_reload(enum channelreloadreason reason)
|
||||
/*! \brief Force reload of module from cli */
|
||||
static char *sip_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||
{
|
||||
static struct sip_peer *tmp_peer, *new_peer;
|
||||
|
||||
switch (cmd) {
|
||||
case CLI_INIT:
|
||||
@@ -30439,6 +30458,18 @@ static char *sip_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a
|
||||
ast_mutex_unlock(&sip_reload_lock);
|
||||
restart_monitor();
|
||||
|
||||
tmp_peer = bogus_peer;
|
||||
/* Create new bogus peer possibly with new global settings. */
|
||||
if ((new_peer = temp_peer("(bogus_peer)"))) {
|
||||
ast_string_field_set(new_peer, md5secret, BOGUS_PEER_MD5SECRET);
|
||||
ast_clear_flag(&new_peer->flags[0], SIP_INSECURE);
|
||||
bogus_peer = new_peer;
|
||||
ao2_t_ref(tmp_peer, -1, "unref the old bogus_peer during reload");
|
||||
} else {
|
||||
ast_log(LOG_ERROR, "Could not update the fake authentication peer.\n");
|
||||
/* You probably have bigger (memory?) issues to worry about though.. */
|
||||
}
|
||||
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -31622,6 +31653,17 @@ static int load_module(void)
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
/* Initialize bogus peer. Can be done first after reload_config() */
|
||||
if (!(bogus_peer = temp_peer("(bogus_peer)"))) {
|
||||
ast_log(LOG_ERROR, "Unable to create bogus_peer for authentication\n");
|
||||
io_context_destroy(io);
|
||||
sched_context_destroy(sched);
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
/* Make sure the auth will always fail. */
|
||||
ast_string_field_set(bogus_peer, md5secret, BOGUS_PEER_MD5SECRET);
|
||||
ast_clear_flag(&bogus_peer->flags[0], SIP_INSECURE);
|
||||
|
||||
/* Prepare the version that does not require DTMF BEGIN frames.
|
||||
* We need to use tricks such as memcpy and casts because the variable
|
||||
* has const fields.
|
||||
@@ -31632,6 +31674,7 @@ static int load_module(void)
|
||||
/* Make sure we can register our sip channel type */
|
||||
if (ast_channel_register(&sip_tech)) {
|
||||
ast_log(LOG_ERROR, "Unable to register channel type 'SIP'\n");
|
||||
ao2_t_ref(bogus_peer, -1, "unref the bogus_peer");
|
||||
io_context_destroy(io);
|
||||
sched_context_destroy(sched);
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
@@ -31873,6 +31916,8 @@ static int unload_module(void)
|
||||
ast_debug(2, "TCP/TLS thread container did not become empty :(\n");
|
||||
}
|
||||
|
||||
ao2_t_ref(bogus_peer, -1, "unref the bogus_peer");
|
||||
|
||||
ao2_t_ref(peers, -1, "unref the peers table");
|
||||
ao2_t_ref(peers_by_ip, -1, "unref the peers_by_ip table");
|
||||
ao2_t_ref(dialogs, -1, "unref the dialogs table");
|
||||
|
||||
@@ -471,7 +471,6 @@ enum check_auth_result {
|
||||
AUTH_SECRET_FAILED = -1,
|
||||
AUTH_USERNAME_MISMATCH = -2,
|
||||
AUTH_NOT_FOUND = -3, /*!< returned by register_verify */
|
||||
AUTH_FAKE_AUTH = -4,
|
||||
AUTH_UNKNOWN_DOMAIN = -5,
|
||||
AUTH_PEER_NOT_DYNAMIC = -6,
|
||||
AUTH_ACL_FAILED = -7,
|
||||
|
||||
24
main/cdr.c
24
main/cdr.c
@@ -109,6 +109,8 @@ static const int BATCH_SCHEDULER_ONLY_DEFAULT = 0;
|
||||
static int batchsafeshutdown;
|
||||
static const int BATCH_SAFE_SHUTDOWN_DEFAULT = 1;
|
||||
|
||||
AST_MUTEX_DEFINE_STATIC(cdr_sched_lock);
|
||||
|
||||
AST_MUTEX_DEFINE_STATIC(cdr_batch_lock);
|
||||
|
||||
/* these are used to wake up the CDR thread when there's work to do */
|
||||
@@ -1300,17 +1302,24 @@ static int submit_scheduled_batch(const void *data)
|
||||
{
|
||||
ast_cdr_submit_batch(0);
|
||||
/* manually reschedule from this point in time */
|
||||
ast_mutex_lock(&cdr_sched_lock);
|
||||
cdr_sched = ast_sched_add(sched, batchtime * 1000, submit_scheduled_batch, NULL);
|
||||
ast_mutex_unlock(&cdr_sched_lock);
|
||||
/* returning zero so the scheduler does not automatically reschedule */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Do not hold the batch lock while calling this function */
|
||||
static void submit_unscheduled_batch(void)
|
||||
{
|
||||
/* Prevent two deletes from happening at the same time */
|
||||
ast_mutex_lock(&cdr_sched_lock);
|
||||
/* this is okay since we are not being called from within the scheduler */
|
||||
AST_SCHED_DEL(sched, cdr_sched);
|
||||
/* schedule the submission to occur ASAP (1 ms) */
|
||||
cdr_sched = ast_sched_add(sched, 1, submit_scheduled_batch, NULL);
|
||||
ast_mutex_unlock(&cdr_sched_lock);
|
||||
|
||||
/* signal the do_cdr thread to wakeup early and do some work (that lazy thread ;) */
|
||||
ast_mutex_lock(&cdr_pending_lock);
|
||||
ast_cond_signal(&cdr_pending_cond);
|
||||
@@ -1321,6 +1330,7 @@ void ast_cdr_detach(struct ast_cdr *cdr)
|
||||
{
|
||||
struct ast_cdr_batch_item *newtail;
|
||||
int curr;
|
||||
int submit_batch = 0;
|
||||
|
||||
if (!cdr)
|
||||
return;
|
||||
@@ -1367,10 +1377,14 @@ void ast_cdr_detach(struct ast_cdr *cdr)
|
||||
|
||||
/* if we have enough stuff to post, then do it */
|
||||
if (curr >= (batchsize - 1)) {
|
||||
submit_batch = 1;
|
||||
}
|
||||
ast_mutex_unlock(&cdr_batch_lock);
|
||||
|
||||
/* Don't call submit_unscheduled_batch with the cdr_batch_lock held */
|
||||
if (submit_batch) {
|
||||
submit_unscheduled_batch();
|
||||
}
|
||||
|
||||
ast_mutex_unlock(&cdr_batch_lock);
|
||||
}
|
||||
|
||||
static void *do_cdr(void *data)
|
||||
@@ -1522,7 +1536,9 @@ static void do_reload(int reload)
|
||||
}
|
||||
|
||||
/* don't run the next scheduled CDR posting while reloading */
|
||||
ast_mutex_lock(&cdr_sched_lock);
|
||||
AST_SCHED_DEL(sched, cdr_sched);
|
||||
ast_mutex_unlock(&cdr_sched_lock);
|
||||
|
||||
if (config) {
|
||||
if ((enabled_value = ast_variable_retrieve(config, "general", "enable"))) {
|
||||
@@ -1565,7 +1581,9 @@ static void do_reload(int reload)
|
||||
if (enabled && !batchmode) {
|
||||
ast_log(LOG_NOTICE, "CDR simple logging enabled.\n");
|
||||
} else if (enabled && batchmode) {
|
||||
ast_mutex_lock(&cdr_sched_lock);
|
||||
cdr_sched = ast_sched_add(sched, batchtime * 1000, submit_scheduled_batch, NULL);
|
||||
ast_mutex_unlock(&cdr_sched_lock);
|
||||
ast_log(LOG_NOTICE, "CDR batch mode logging enabled, first of either size %d or time %d seconds.\n", batchsize, batchtime);
|
||||
} else {
|
||||
ast_log(LOG_NOTICE, "CDR logging disabled, data will be lost.\n");
|
||||
@@ -1577,7 +1595,9 @@ static void do_reload(int reload)
|
||||
ast_cond_init(&cdr_pending_cond, NULL);
|
||||
if (ast_pthread_create_background(&cdr_thread, NULL, do_cdr, NULL) < 0) {
|
||||
ast_log(LOG_ERROR, "Unable to start CDR thread.\n");
|
||||
ast_mutex_lock(&cdr_sched_lock);
|
||||
AST_SCHED_DEL(sched, cdr_sched);
|
||||
ast_mutex_unlock(&cdr_sched_lock);
|
||||
} else {
|
||||
ast_cli_register(&cli_submit);
|
||||
ast_register_atexit(ast_cdr_engine_term);
|
||||
|
||||
@@ -612,6 +612,8 @@ static void http_decode(char *s)
|
||||
ast_uri_decode(s);
|
||||
}
|
||||
|
||||
#define MAX_POST_CONTENT 1025
|
||||
|
||||
/*
|
||||
* get post variables from client Request Entity-Body, if content type is
|
||||
* application/x-www-form-urlencoded
|
||||
@@ -644,6 +646,13 @@ struct ast_variable *ast_http_get_post_vars(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (content_length > MAX_POST_CONTENT - 1) {
|
||||
ast_log(LOG_WARNING, "Excessively long HTTP content. %d is greater than our max of %d\n",
|
||||
content_length, MAX_POST_CONTENT);
|
||||
ast_http_send(ser, AST_HTTP_POST, 413, "Request Entity Too Large", NULL, NULL, 0, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = ast_malloc(content_length + 1);
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
|
||||
@@ -1273,6 +1273,7 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
|
||||
enum ast_rtp_dtmf_mode dmode;
|
||||
format_t codec0 = 0, codec1 = 0;
|
||||
int unlock_chans = 1;
|
||||
int read_ptime0, read_ptime1, write_ptime0, write_ptime1;
|
||||
|
||||
/* Lock both channels so we can look for the glue that binds them together */
|
||||
ast_channel_lock(c0);
|
||||
@@ -1352,6 +1353,18 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
|
||||
goto done;
|
||||
}
|
||||
|
||||
read_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, c0->rawreadformat)).cur_ms;
|
||||
read_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, c1->rawreadformat)).cur_ms;
|
||||
write_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, c0->rawwriteformat)).cur_ms;
|
||||
write_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, c1->rawwriteformat)).cur_ms;
|
||||
|
||||
if (read_ptime0 != write_ptime1 || read_ptime1 != write_ptime0) {
|
||||
ast_debug(1, "Packetization differs between RTP streams (%d != %d or %d != %d). Cannot native bridge in RTP\n",
|
||||
read_ptime0, write_ptime1, read_ptime1, write_ptime0);
|
||||
res = AST_BRIDGE_FAILED_NOWARN;
|
||||
goto done;
|
||||
}
|
||||
|
||||
instance0->glue = glue0;
|
||||
instance1->glue = glue1;
|
||||
instance0->chan = c0;
|
||||
|
||||
@@ -366,7 +366,7 @@ static int __rtp_recvfrom(struct ast_rtp_instance *instance, void *buf, size_t s
|
||||
return len;
|
||||
}
|
||||
|
||||
if ((*in > 1) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
|
||||
if ((*in & 0xC0) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user