From: Mark Michelson Date: Wed, 4 Apr 2012 21:20:35 +0000 (+0000) Subject: Fix compiler errors. X-Git-Tag: 10.4.0-digiumphones-rc1~3^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1648243e7d62ff660c87ac296632fdd6297326;p=thirdparty%2Fasterisk.git 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 --- diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index f09b1d2ae5..5c665b7fd1 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -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. */ diff --git a/apps/app_queue.c b/apps/app_queue.c index ee41e92f80..b1cdaae999 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -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; diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 7f91bc551b..8c0a70470b 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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))); } } diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d426860180..6289bca25b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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; diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 3af0298617..755584b85a 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -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); } } } diff --git a/main/file.c b/main/file.c index 186acd1d2a..e0ee9633f0 100644 --- a/main/file.c +++ b/main/file.c @@ -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); } } diff --git a/main/message.c b/main/message.c index 30a75f1d05..ad78606c5a 100644 --- a/main/message.c +++ b/main/message.c @@ -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); }