]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix compiler errors.
authorMark Michelson <mmichelson@digium.com>
Wed, 4 Apr 2012 21:20:35 +0000 (21:20 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 4 Apr 2012 21:20:35 +0000 (21:20 +0000)
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

apps/app_mixmonitor.c
apps/app_queue.c
apps/app_voicemail.c
channels/chan_sip.c
channels/chan_skinny.c
main/file.c
main/message.c

index f09b1d2ae5c2c9a740a8e214d96d7c425893e877..5c665b7fd163534e78697ba6b9726cb34493ef5d 100644 (file)
@@ -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. */
index ee41e92f80a6db2d378ea2e3030d3b0773aa9e18..b1cdaae999bec420d4d80f2bab1fb9a4831fd119 100644 (file)
@@ -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;
index 7f91bc551b6680b9e9e83e898e03ef8450e671d0..8c0a70470b2f925ed44d30da9bd522d142759b1b 100644 (file)
@@ -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)));
                }
        }
 
index d42686018014c3a45b4d6aba4dc5e43a5ccbe47c..6289bca25ba38873bffb03b72251ebb42c40d645 100644 (file)
@@ -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;
index 3af02986173cd32d891bbb554070faa8dbc611d5..755584b85ab347080c00d314c0a4bfa318388a35 100644 (file)
@@ -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);
                                                        }
                                                }
                                        }
index 186acd1d2a21560b0158d93404b8f667043ec113..e0ee9633f0fd6077340901fb90581dd3174a218a 100644 (file)
@@ -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);
                                        }
                                }
index 30a75f1d053e826141870a39b40b531fa9229343..ad78606c5a8d0f217201e63fa23e23210ae6ab12 100644 (file)
@@ -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);
        }