[asterisk-commits] mmichelson: branch 10-digiumphones r361262 - in /branches/10-digiumphones: ap...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Apr 4 16:20:41 CDT 2012
Author: mmichelson
Date: Wed Apr 4 16:20:35 2012
New Revision: 361262
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361262
Log:
Fix compiler errors.
Next up is to do some testing to be sure things are sane.
Modified:
branches/10-digiumphones/apps/app_mixmonitor.c
branches/10-digiumphones/apps/app_queue.c
branches/10-digiumphones/apps/app_voicemail.c
branches/10-digiumphones/channels/chan_sip.c
branches/10-digiumphones/channels/chan_skinny.c
branches/10-digiumphones/main/file.c
branches/10-digiumphones/main/message.c
Modified: branches/10-digiumphones/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/apps/app_mixmonitor.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/apps/app_mixmonitor.c (original)
+++ branches/10-digiumphones/apps/app_mixmonitor.c Wed Apr 4 16:20:35 2012
@@ -469,11 +469,11 @@
* \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 @@
}
/* 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. */
Modified: branches/10-digiumphones/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/apps/app_queue.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/apps/app_queue.c (original)
+++ branches/10-digiumphones/apps/app_queue.c Wed Apr 4 16:20:35 2012
@@ -1572,7 +1572,7 @@
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;
Modified: branches/10-digiumphones/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/apps/app_voicemail.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/apps/app_voicemail.c (original)
+++ branches/10-digiumphones/apps/app_voicemail.c Wed Apr 4 16:20:35 2012
@@ -5659,7 +5659,12 @@
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)));
}
}
Modified: branches/10-digiumphones/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/channels/chan_sip.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/channels/chan_sip.c (original)
+++ branches/10-digiumphones/channels/chan_sip.c Wed Apr 4 16:20:35 2012
@@ -25474,7 +25474,6 @@
{
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;
Modified: branches/10-digiumphones/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/channels/chan_skinny.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/channels/chan_skinny.c (original)
+++ branches/10-digiumphones/channels/chan_skinny.c Wed Apr 4 16:20:35 2012
@@ -5004,10 +5004,13 @@
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);
}
}
}
Modified: branches/10-digiumphones/main/file.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/main/file.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/main/file.c (original)
+++ branches/10-digiumphones/main/file.c Wed Apr 4 16:20:35 2012
@@ -1267,7 +1267,7 @@
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 @@
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);
}
}
Modified: branches/10-digiumphones/main/message.c
URL: http://svnview.digium.com/svn/asterisk/branches/10-digiumphones/main/message.c?view=diff&rev=361262&r1=361261&r2=361262
==============================================================================
--- branches/10-digiumphones/main/message.c (original)
+++ branches/10-digiumphones/main/message.c Wed Apr 4 16:20:35 2012
@@ -844,6 +844,41 @@
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 {
+ ast_log(LOG_WARNING, "Invalid argument to MESSAGE(): '%s'\n", data);
+ }
+
+ ao2_unlock(msg);
+ ao2_ref(msg, -1);
+
+ return 0;
+}
+
+static int msg_func_write(struct ast_channel *chan, const char *function,
+ char *data, const char *value)
+{
+ struct ast_datastore *ds;
+ struct ast_msg *msg;
+
+ ast_channel_lock(chan);
+
+ if (!(ds = msg_datastore_find_or_create(chan))) {
+ ast_channel_unlock(chan);
+ return -1;
+ }
+
+ msg = ds->data;
+ ao2_ref(msg, +1);
+ ast_channel_unlock(chan);
+
+ ao2_lock(msg);
+
+ if (!strcasecmp(data, "to")) {
+ ast_msg_set_to(msg, "%s", value);
+ } else if (!strcasecmp(data, "from")) {
+ 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")) {
@@ -864,42 +899,6 @@
}
ao2_iterator_destroy(&iter);
}
-
- } else {
- ast_log(LOG_WARNING, "Invalid argument to MESSAGE(): '%s'\n", data);
- }
-
- ao2_unlock(msg);
- ao2_ref(msg, -1);
-
- return 0;
-}
-
-static int msg_func_write(struct ast_channel *chan, const char *function,
- char *data, const char *value)
-{
- struct ast_datastore *ds;
- struct ast_msg *msg;
-
- ast_channel_lock(chan);
-
- if (!(ds = msg_datastore_find_or_create(chan))) {
- ast_channel_unlock(chan);
- return -1;
- }
-
- msg = ds->data;
- ao2_ref(msg, +1);
- ast_channel_unlock(chan);
-
- ao2_lock(msg);
-
- if (!strcasecmp(data, "to")) {
- ast_msg_set_to(msg, "%s", value);
- } else if (!strcasecmp(data, "from")) {
- ast_msg_set_from(msg, "%s", value);
- } else if (!strcasecmp(data, "body")) {
- ast_msg_set_body(msg, "%s", value);
} else {
ast_log(LOG_WARNING, "'%s' is not a valid write argument.\n", data);
}
More information about the asterisk-commits
mailing list