Compare commits

...

20 Commits

Author SHA1 Message Date
Asterisk Autobuilder
38bdeb7ea7 Importing release summary for 1.8.12.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.2@367969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-30 14:40:27 +00:00
Asterisk Autobuilder
ab29e5176a Merge r367266 for 1.8.12.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.2@367963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-30 14:22:24 +00:00
Asterisk Autobuilder
a9d530433c Create 1.8.12.2 tag
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.2@367957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-30 13:28:29 +00:00
Asterisk Autobuilder
564e0123bb Importing release summary for 1.8.12.1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.1@367853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-29 19:15:53 +00:00
Asterisk Autobuilder
d1393fad6e Merge 367843,367781
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.1@367850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-29 18:54:14 +00:00
Asterisk Autobuilder
7af636e697 Create 1.8.12.1 tag
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.1@367564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-24 13:40:02 +00:00
Asterisk Autobuilder
3665ed1d29 Importing release summary for 1.8.12.0 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0@365065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-02 16:51:31 +00:00
Asterisk Autobuilder
a9244368dc Update .version, ChangeLog for 1.8.12.0
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0@365012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-02 16:03:54 +00:00
Asterisk Autobuilder
77a50e81cb Create 1.8.12.0 tag
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0@365007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-02 15:53:05 +00:00
Asterisk Autobuilder
cdb018cfbd Importing release summary for 1.8.12.0-rc3 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc3@364764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01 17:44:37 +00:00
Asterisk Autobuilder
815f94df5e Merge 364706 for 1.8.12.0-rc3
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc3@364763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01 17:31:50 +00:00
Asterisk Autobuilder
091e62249b Create tag for 1.8.12.0-rc3
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc3@364759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01 17:22:44 +00:00
Asterisk Autobuilder
52023c323a Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc2@363334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-24 17:09:47 +00:00
Asterisk Autobuilder
c4bff5a35d Importing release summary for 1.8.12.0-rc2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc2@363333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-24 17:09:35 +00:00
Asterisk Autobuilder
6f352370c8 Merge r363102, r363106, r363141 for rc2
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc2@363331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-24 15:57:31 +00:00
Asterisk Autobuilder
67e4d0f83f Create 1.8.12.0-rc2 tag
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc2@363329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-24 15:39:29 +00:00
Asterisk Autobuilder
ce85cca048 Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc1@361159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:17:07 +00:00
Asterisk Autobuilder
5e5f2cb616 Importing release summary for 1.8.12.0-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc1@361158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:16:50 +00:00
Asterisk Autobuilder
d62df6cd15 Importing files for 1.8.12.0-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc1@361157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:16:40 +00:00
Asterisk Autobuilder
56ec76d2c2 Creating tag for the release of asterisk-1.8.12.0-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.12.0-rc1@361156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:15:27 +00:00
9 changed files with 39057 additions and 44 deletions

3
.lastclean Normal file
View File

@@ -0,0 +1,3 @@
39

1
.version Normal file
View File

@@ -0,0 +1 @@
1.8.12.2

38784
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.8.12.2</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.8.12.2</h3>
<h3 align="center">Date: 2012-05-30</h3>
<h3 align="center">&lt;asteriskteam@digium.com&gt;</h3>
<hr/>
<h2 align="center">Table of Contents</h2>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol>
<hr/>
<a name="summary"><h2 align="center">Summary</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This release 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.1.</p>
<hr/>
<a name="contributors"><h2 align="center">Contributors</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
<table width="100%" border="0">
<tr>
<td width="33%"><h3>Coders</h3></td>
<td width="33%"><h3>Testers</h3></td>
<td width="33%"><h3>Reporters</h3></td>
</tr>
<tr valign="top">
<td>
2 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=367957">367957</a></td><td>bebuild</td><td>Create 1.8.12.2 tag</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=367963">367963</a></td><td>bebuild</td><td>Merge r367266 for 1.8.12.2</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.12.1-summary.html | 62 ----------------------------
asterisk-1.8.12.1-summary.txt | 90 -----------------------------------------
channels/chan_sip.c | 13 +++--
5 files changed, 25 insertions(+), 158 deletions(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,88 @@
Release Summary
asterisk-1.8.12.2
Date: 2012-05-30
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Other Changes
4. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
This release includes only bug fixes. The changes included were made only
to address problems that have been identified in this release series.
Users should be able to safely upgrade to this version if this release
series is already in use. Users considering upgrading from a previous
release series are strongly encouraged to review the UPGRADE.txt document
as well as the CHANGES document for information about upgrading to this
release series.
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.8.12.1.
----------------------------------------------------------------------
Contributors
[Back to Top]
This table lists the people who have submitted code, those that have
tested patches, as well as those that reported issues on the issue tracker
that were resolved in this release. For coders, the number is how many of
their patches (of any size) were committed into this release. For testers,
the number is the number of times their name was listed as assisting with
testing a patch. Finally, for reporters, the number is the number of
issues that they reported that were closed by commits that went into this
release.
Coders Testers Reporters
2 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 |
|-----------+----------+-----------------------------+-------------------|
| 367957 | bebuild | Create 1.8.12.2 tag | |
|-----------+----------+-----------------------------+-------------------|
| 367963 | bebuild | Merge r367266 for 1.8.12.2 | |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
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.12.1-summary.html | 62 ----------------------------
asterisk-1.8.12.1-summary.txt | 90 -----------------------------------------
channels/chan_sip.c | 13 +++--
5 files changed, 25 insertions(+), 158 deletions(-)
----------------------------------------------------------------------

View File

@@ -1842,24 +1842,25 @@ static void send_signaling(struct chan_iax2_pvt *pvt)
* we have received a destination call number. */
static int queue_signalling(struct chan_iax2_pvt *pvt, struct ast_frame *f)
{
struct signaling_queue_entry *new;
struct signaling_queue_entry *qe;
if (f->frametype == AST_FRAME_IAX || !pvt->hold_signaling) {
return 1; /* do not queue this frame */
} else if (!(new = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
} else if (!(qe = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
return -1; /* out of memory */
}
memcpy(&new->f, f, sizeof(new->f)); /* copy ast_frame into our queue entry */
if (new->f.datalen) { /* if there is data in this frame copy it over as well */
if (!(new->f.data.ptr = ast_calloc(1, new->f.datalen))) {
free_signaling_queue_entry(new);
/* copy ast_frame into our queue entry */
qe->f = *f;
if (qe->f.datalen) {
/* if there is data in this frame copy it over as well */
if (!(qe->f.data.ptr = ast_malloc(qe->f.datalen))) {
free_signaling_queue_entry(qe);
return -1;
}
memcpy(new->f.data.ptr, f->data.ptr, sizeof(*new->f.data.ptr));
memcpy(qe->f.data.ptr, f->data.ptr, qe->f.datalen);
}
AST_LIST_INSERT_TAIL(&pvt->signaling_queue, new, next);
AST_LIST_INSERT_TAIL(&pvt->signaling_queue, qe, next);
return 0;
}
@@ -4160,7 +4161,16 @@ static int schedule_delivery(struct iax_frame *fr, int updatehistory, int fromtr
int needfree = 0;
struct ast_channel *owner = NULL;
struct ast_channel *bridge = NULL;
/*
* Clear fr->af.data if there is no data in the buffer. Things
* like AST_CONTROL_HOLD without a suggested music class must
* have a NULL pointer.
*/
if (!fr->af.datalen) {
memset(&fr->af.data, 0, sizeof(fr->af.data));
}
/* Attempt to recover wrapped timestamps */
unwrap_timestamp(fr);

View File

@@ -12408,13 +12408,14 @@ static int __sip_subscribe_mwi_do(struct sip_subscription_mwi *mwi)
/* If we have no DNS manager let's do a lookup */
if (!mwi->dnsmgr) {
char transport[MAXHOSTNAMELEN];
struct sip_subscription_mwi *saved;
snprintf(transport, sizeof(transport), "_%s._%s", get_srv_service(mwi->transport), get_srv_protocol(mwi->transport));
mwi->us.ss.ss_family = get_address_family_filter(&bindaddr); /* Filter address family */
ASTOBJ_REF(mwi); /* Add a ref for storing the mwi on the dnsmgr for updates */
ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, mwi);
saved = ASTOBJ_REF(mwi);
ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, saved);
if (!mwi->dnsmgr) {
ASTOBJ_UNREF(mwi, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
}
}
@@ -12617,8 +12618,6 @@ static void state_notify_build_xml(int state, int full, const char *exten, const
if ((state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
const char *local_display = exten;
char *local_target = ast_strdupa(mto);
const char *remote_display = exten;
char *remote_target = ast_strdupa(mfrom);
/* 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
@@ -12628,28 +12627,16 @@ static void state_notify_build_xml(int state, int full, const char *exten, const
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:@");
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, ""));
snprintf(local_target, need, "sip:%s@%s", cid_num, p->fromdomain);
local_display = ast_strdupa(S_COR(caller->caller.id.name.valid,
caller->caller.id.name.str, ""));
ast_channel_unlock(caller);
caller = ast_channel_unref(caller);
}
@@ -12671,10 +12658,10 @@ static void state_notify_build_xml(int state, int full, const char *exten, const
"<target uri=\"%s\"/>\n"
"</remote>\n"
"<local>\n"
"<identity display=\"%s\">%s</identity>\n"
"<identity>%s</identity>\n"
"<target uri=\"%s\"/>\n"
"</local>\n",
remote_display, remote_target, remote_target, local_display, local_target, local_target);
local_display, local_target, local_target, mto, mto);
} else {
ast_str_append(tmp, 0, "<dialog id=\"%s\" direction=\"recipient\">\n", exten);
}
@@ -22148,6 +22135,10 @@ static int handle_request_update(struct sip_pvt *p, struct sip_request *req)
transmit_response(p, "501 Method Not Implemented", req);
return 0;
}
if (!p->owner) {
transmit_response(p, "481 Call/Transaction Does Not Exist", req);
return 0;
}
if (get_rpid(p, req)) {
struct ast_party_connected_line connected;
struct ast_set_party_connected_line update_connected;
@@ -29567,10 +29558,12 @@ static void sip_send_all_registers(void)
static void sip_send_all_mwi_subscriptions(void)
{
ASTOBJ_CONTAINER_TRAVERSE(&submwil, 1, do {
struct sip_subscription_mwi *saved;
ASTOBJ_WRLOCK(iterator);
AST_SCHED_DEL(sched, iterator->resub);
if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, ASTOBJ_REF(iterator))) < 0) {
ASTOBJ_UNREF(iterator, sip_subscribe_mwi_destroy);
saved = ASTOBJ_REF(iterator);
if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, saved)) < 0) {
ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy);
}
ASTOBJ_UNLOCK(iterator);
} while (0));

View File

@@ -2677,6 +2677,10 @@ static void update_connectedline(struct skinny_subchannel *sub, const void *data
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
if (!d) {
return;
}
if (!c->caller.id.number.valid
|| ast_strlen_zero(c->caller.id.number.str)
|| !c->connected.id.number.valid
@@ -3810,6 +3814,11 @@ static void *skinny_ss(void *data)
int res = 0;
int loop_pause = 100;
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return NULL;
}
ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
len = strlen(d->exten);
@@ -3913,7 +3922,7 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
if (!d->registered) {
if (!d || !d->registered) {
ast_log(LOG_ERROR, "Device not registered, cannot call %s\n", dest);
return -1;
}
@@ -3977,6 +3986,11 @@ static int skinny_hangup(struct ast_channel *ast)
l = sub->parent;
d = l->device;
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return 0;
}
if (skinnydebug)
ast_verb(3,"Hanging up %s/%d\n",d->name,sub->callid);
@@ -4374,7 +4388,13 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
struct skinny_subchannel *sub = ast->tech_pvt;
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
struct skinnysession *s = d->session;
struct skinnysession *s;
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return -1;
}
s = d->session;
if (!s) {
ast_log(LOG_NOTICE, "Asked to indicate '%s' condition on channel %s, but session does not exist.\n", control2str(ind), ast->name);
@@ -4608,8 +4628,13 @@ static int skinny_hold(struct skinny_subchannel *sub)
struct skinny_device *d = l->device;
/* Don't try to hold a channel that doesn't exist */
if (!sub || !sub->owner)
if (!sub || !sub->owner) {
return 0;
}
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return 0;
}
/* Channel needs to be put on hold */
if (skinnydebug)
@@ -4635,8 +4660,13 @@ static int skinny_unhold(struct skinny_subchannel *sub)
struct skinny_device *d = l->device;
/* Don't try to unhold a channel that doesn't exist */
if (!sub || !sub->owner)
if (!sub || !sub->owner) {
return 0;
}
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return 0;
}
/* Channel is on hold, so we will unhold */
if (skinnydebug)
@@ -4690,6 +4720,11 @@ static int handle_transfer_button(struct skinny_subchannel *sub)
l = sub->parent;
d = l->device;
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return -1;
}
if (!sub->related) {
/* Another sub has not been created so this must be first XFER press */
if (!sub->onhold) {
@@ -4821,6 +4856,11 @@ static int handle_callforward_button(struct skinny_subchannel *sub, int cfwdtype
struct ast_channel *c = sub->owner;
pthread_t t;
if (!d) {
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
return 0;
}
if (l->hookstate == SKINNY_ONHOOK) {
l->hookstate = SKINNY_OFFHOOK;
transmit_speaker_mode(d, SKINNY_SPEAKERON);
@@ -6141,7 +6181,8 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
struct skinny_speeddial *sd;
struct skinny_line *l;
struct skinny_device *d = s->device;
size_t len;
if ((!s->device) && (letohl(req->e) != REGISTER_MESSAGE && letohl(req->e) != ALARM_MESSAGE)) {
ast_log(LOG_WARNING, "Client sent message #%d without first registering.\n", req->e);
ast_free(req);
@@ -6206,8 +6247,13 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
ast_log(LOG_WARNING, "Unsupported digit %d\n", digit);
}
d->exten[strlen(d->exten)] = dgt;
d->exten[strlen(d->exten)+1] = '\0';
len = strlen(d->exten);
if (len < sizeof(d->exten) - 1) {
d->exten[len] = dgt;
d->exten[len + 1] = '\0';
} else {
ast_log(AST_LOG_WARNING, "Dropping digit with value %d because digit queue is full\n", dgt);
}
} else
res = handle_keypad_button_message(req, s);
}

View File

@@ -1179,6 +1179,19 @@ static const struct permalias {
{ 0, "none" },
};
/*! \brief Checks to see if a string which can be used to evaluate functions should be rejected */
static int function_capable_string_allowed_with_auths(const char *evaluating, int writepermlist)
{
if (!(writepermlist & EVENT_FLAG_SYSTEM)
&& (
strstr(evaluating, "SHELL") || /* NoOp(${SHELL(rm -rf /)}) */
strstr(evaluating, "EVAL") /* NoOp(${EVAL(${some_var_containing_SHELL})}) */
)) {
return 0;
}
return 1;
}
/*! \brief Convert authority code to a list of options */
static const char *authority_to_str(int authority, struct ast_str **res)
{
@@ -3177,6 +3190,12 @@ static int action_getvar(struct mansession *s, const struct message *m)
return 0;
}
/* We don't want users with insufficient permissions using certain functions. */
if (!(function_capable_string_allowed_with_auths(varname, s->session->writeperm))) {
astman_send_error(s, m, "GetVar Access Forbidden: Variable");
return 0;
}
if (!ast_strlen_zero(name)) {
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
@@ -3237,6 +3256,11 @@ static int action_status(struct mansession *s, const struct message *m)
idText[0] = '\0';
}
if (!(function_capable_string_allowed_with_auths(variables, s->session->writeperm))) {
astman_send_error(s, m, "Status Access Forbidden: Variables");
return 0;
}
if (all) {
if (!(iter = ast_channel_iterator_all_new())) {
ast_free(str);
@@ -4028,6 +4052,7 @@ static int action_originate(struct mansession *s, const struct message *m)
ast_parse_allow_disallow(NULL, &format, codecs, 1);
}
if (!ast_strlen_zero(app)) {
int bad_appdata = 0;
/* To run the System application (or anything else that goes to
* shell), you must have the additional System privilege */
if (!(s->session->writeperm & EVENT_FLAG_SYSTEM)
@@ -4038,10 +4063,13 @@ static int action_originate(struct mansession *s, const struct message *m)
TryExec(System(rm -rf /)) */
strcasestr(app, "agi") || /* AGI(/bin/rm,-rf /)
EAGI(/bin/rm,-rf /) */
strstr(appdata, "SHELL") || /* NoOp(${SHELL(rm -rf /)}) */
strstr(appdata, "EVAL") /* NoOp(${EVAL(${some_var_containing_SHELL})}) */
strcasestr(app, "mixmonitor") || /* MixMonitor(blah,,rm -rf) */
(strstr(appdata, "SHELL") && (bad_appdata = 1)) || /* NoOp(${SHELL(rm -rf /)}) */
(strstr(appdata, "EVAL") && (bad_appdata = 1)) /* NoOp(${EVAL(${some_var_containing_SHELL})}) */
)) {
astman_send_error(s, m, "Originate with certain 'Application' arguments requires the additional System privilege, which you do not have.");
char error_buf[64];
snprintf(error_buf, sizeof(error_buf), "Originate Access Forbidden: %s", bad_appdata ? "Data" : "Application");
astman_send_error(s, m, error_buf);
return 0;
}
}