Fix compiler errors.

Next up is to do some testing to be sure things are sane.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@361262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
10-digiumphones
Mark Michelson 14 years ago
parent 1cd169d034
commit 7e1648243e

@ -469,11 +469,11 @@ static void mixmonitor_save_prep(struct mixmonitor *mixmonitor, char *filename,
* \param mixmonitor The mixmonitor that needs to forward its file to recipients
* \param ext Format of the file that was saved
*/
static void copy_to_voicemail(struct mixmonitor *mixmonitor, char *ext)
static void copy_to_voicemail(struct mixmonitor *mixmonitor, char *ext, const char *filename)
{
struct vm_recipient *recipient = NULL;
struct ast_vm_recording_data recording_data;
char filename[PATH_MAX];
char full_filename[PATH_MAX];
if (ast_string_field_init(&recording_data, 512)) {
ast_log(LOG_ERROR, "Failed to string_field_init, skipping copy_to_voicemail\n");
@ -501,9 +501,9 @@ static void copy_to_voicemail(struct mixmonitor *mixmonitor, char *ext)
}
/* Delete the source file */
snprintf(filename, sizeof(filename), "%s.%s", mixmonitor->filename, ext);
if (remove(filename)) {
ast_log(LOG_ERROR, "Failed to delete recording source file %s\n", filename);
snprintf(full_filename, sizeof(full_filename), "%s.%s", filename, ext);
if (remove(full_filename)) {
ast_log(LOG_ERROR, "Failed to delete recording source file %s\n", full_filename);
}
/* Free the string fields for recording_data before exiting the function. */

@ -1572,7 +1572,7 @@ static int extensionstate2devicestate(int state)
return state;
}
static int extension_state_cb(const char *context, const char *exten, enum ast_extension_states state, void *data)
static int extension_state_cb(char *context, char *exten, struct ast_state_cb_info *info, void *data)
{
struct ao2_iterator miter, qiter;
struct member *m;

@ -5659,7 +5659,12 @@ static int msg_create_from_file(struct ast_vm_recording_data *recdata)
if ((recording_fs = ast_readfile(recdata->recording_file, recdata->recording_ext, NULL, 0, 0, VOICEMAIL_DIR_MODE))) {
if (!ast_seekstream(recording_fs, 0, SEEK_END)) {
long framelength = ast_tellstream(recording_fs);
duration = (int) (framelength / ast_format_rate(ast_getformatbyname(recdata->recording_ext)));
struct ast_format result;
/* XXX This use of ast_getformatbyname seems incorrect here. The file extension does not necessarily correspond
* to the name of the format. For instance, if "raw" were passed in, I don't think ast_getformatbyname would
* find the slinear format
*/
duration = (int) (framelength / ast_format_rate(ast_getformatbyname(recdata->recording_ext, &result)));
}
}

@ -25474,7 +25474,6 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
{
int gotdest = 0;
int res = 0;
int firststate;
struct sip_peer *authpeer = NULL;
const char *eventheader = sip_get_header(req, "Event"); /* Get Event package name */
int resubscribe = (p->subscribed != NONE) && !req->ignore;

@ -5004,10 +5004,13 @@ static void setsubstate(struct skinny_subchannel *sub, int state)
AST_LIST_TRAVERSE(&tmpline->sublines, tmpsubline, list) {
if (!(subline == tmpsubline)) {
if (!strcasecmp(subline->lnname, tmpsubline->lnname)) {
struct ast_state_cb_info info = {
.exten_state = tmpsubline->extenstate,
};
tmpsubline->callid = callnums++;
transmit_callstate(tmpsubline->line->device, tmpsubline->line->instance, tmpsubline->callid, SKINNY_OFFHOOK);
push_callinfo(tmpsubline, sub);
skinny_extensionstate_cb(NULL, NULL, tmpsubline->extenstate, tmpsubline->container);
skinny_extensionstate_cb(NULL, NULL, &info, tmpsubline->container);
}
}
}

@ -1267,7 +1267,7 @@ static int waitstream_core(struct ast_channel *c,
orig_chan_name = ast_strdupa(c->name);
if (c->stream && cb) {
long ms_len = ast_tellstream(c->stream) / (ast_format_rate(c->stream->fmt->format) / 1000);
long ms_len = ast_tellstream(c->stream) / (ast_format_rate(&c->stream->fmt->format) / 1000);
cb(c, ms_len, AST_WAITSTREAM_CB_START);
}
@ -1353,7 +1353,7 @@ static int waitstream_core(struct ast_channel *c,
return res;
}
if (cb_val && cb) {
long ms_len = ast_tellstream(c->stream) / (ast_format_rate(c->stream->fmt->format) / 1000);
long ms_len = ast_tellstream(c->stream) / (ast_format_rate(&c->stream->fmt->format) / 1000);
cb(c, ms_len, cb_val);
}
}

@ -844,27 +844,6 @@ static int msg_func_read(struct ast_channel *chan, const char *function,
ast_copy_string(buf, ast_str_buffer(msg->from), len);
} else if (!strcasecmp(data, "body")) {
ast_copy_string(buf, ast_msg_get_body(msg), len);
} else if (!strcasecmp(data, "custom_data")) {
int outbound = -1;
if (!strcasecmp(value, "mark_all_outbound")) {
outbound = 1;
} else if (!strcasecmp(value, "clear_all_outbound")) {
outbound = 0;
} else {
ast_log(LOG_WARNING, "'%s' is not a valid value for custom_data\n", value);
}
if (outbound != -1) {
struct msg_data *data;
struct ao2_iterator iter = ao2_iterator_init(msg->vars, 0);
while ((data= ao2_iterator_next(&iter))) {
data->send = outbound;
ao2_ref(data, -1);
}
ao2_iterator_destroy(&iter);
}
} else {
ast_log(LOG_WARNING, "Invalid argument to MESSAGE(): '%s'\n", data);
}
@ -900,6 +879,26 @@ static int msg_func_write(struct ast_channel *chan, const char *function,
ast_msg_set_from(msg, "%s", value);
} else if (!strcasecmp(data, "body")) {
ast_msg_set_body(msg, "%s", value);
} else if (!strcasecmp(data, "custom_data")) {
int outbound = -1;
if (!strcasecmp(value, "mark_all_outbound")) {
outbound = 1;
} else if (!strcasecmp(value, "clear_all_outbound")) {
outbound = 0;
} else {
ast_log(LOG_WARNING, "'%s' is not a valid value for custom_data\n", value);
}
if (outbound != -1) {
struct msg_data *data;
struct ao2_iterator iter = ao2_iterator_init(msg->vars, 0);
while ((data= ao2_iterator_next(&iter))) {
data->send = outbound;
ao2_ref(data, -1);
}
ao2_iterator_destroy(&iter);
}
} else {
ast_log(LOG_WARNING, "'%s' is not a valid write argument.\n", data);
}

Loading…
Cancel
Save