Don't do SIP contact/route DNS if we're not using the result.
[asterisk/asterisk.git] / apps / app_ices.c
index b7eea94..bdccff4 100644 (file)
  *
  * \author Mark Spencer <markster@digium.com>
  * 
- * \extref ICES - http://www.icecast.org/ices.php
+ * ICES - http://www.icecast.org/ices.php
  *
  * \ingroup applications
  */
+
+/*** MODULEINFO
+       <support_level>extended</support_level>
+ ***/
  
 #include "asterisk.h"
 
@@ -93,7 +97,7 @@ static int icesencode(char *filename, int fd)
        execl(path_BIN "ices2", "ices", filename, SENTINEL);
        execlp("ices2", "ices", filename, SENTINEL);
 
-       ast_debug(1, "Couldn't find ices version 2, attempting to use ices version 1.");
+       ast_debug(1, "Couldn't find ices version 2, attempting to use ices version 1.\n");
 
        execl(path_LOCAL "ices", "ices", filename, SENTINEL);
        execl(path_BIN "ices", "ices", filename, SENTINEL);
@@ -112,7 +116,6 @@ static int ices_exec(struct ast_channel *chan, const char *data)
        int pid = -1;
        int flags;
        struct ast_format oreadformat;
-       struct timeval last;
        struct ast_frame *f;
        char filename[256]="";
        char *c;
@@ -123,8 +126,6 @@ static int ices_exec(struct ast_channel *chan, const char *data)
                return -1;
        }
        
-       last = ast_tv(0, 0);
-       
        if (pipe(fds)) {
                ast_log(LOG_WARNING, "Unable to create pipe\n");
                return -1;
@@ -134,7 +135,7 @@ static int ices_exec(struct ast_channel *chan, const char *data)
        
        ast_stopstream(chan);
 
-       if (chan->_state != AST_STATE_UP)
+       if (ast_channel_state(chan) != AST_STATE_UP)
                res = ast_answer(chan);
                
        if (res) {
@@ -144,7 +145,7 @@ static int ices_exec(struct ast_channel *chan, const char *data)
                return -1;
        }
 
-       ast_format_copy(&oreadformat, &chan->readformat);
+       ast_format_copy(&oreadformat, ast_channel_readformat(chan));
        res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR);
        if (res < 0) {
                close(fds[0]);