Replace direct access to channel name with accessor functions
[asterisk/asterisk.git] / apps / app_test.c
index 7d0214a..9e11866 100644 (file)
  * \ingroup applications
  */
 
+/*** MODULEINFO
+       <support_level>extended</support_level>
+ ***/
+
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -195,7 +199,7 @@ static int testclient_exec(struct ast_channel *chan, const char *data)
                snprintf(fn, sizeof(fn), "%s/testresults/%s-client.txt", ast_config_AST_LOG_DIR, testid);
                if ((f = fopen(fn, "w+"))) {
                        setlinebuf(f);
-                       fprintf(f, "CLIENTCHAN:    %s\n", chan->name);
+                       fprintf(f, "CLIENTCHAN:    %s\n", ast_channel_name(chan));
                        fprintf(f, "CLIENTTEST ID: %s\n", testid);
                        fprintf(f, "ANSWER:        PASS\n");
                        res = 0;
@@ -313,7 +317,7 @@ static int testclient_exec(struct ast_channel *chan, const char *data)
                } else
                        res = -1;
        } else {
-               ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
+               ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", ast_channel_name(chan));
                res = -1;
        }
        return res;
@@ -357,7 +361,7 @@ static int testserver_exec(struct ast_channel *chan, const char *data)
                snprintf(fn, sizeof(fn), "%s/testresults/%s-server.txt", ast_config_AST_LOG_DIR, testid);
                if ((f = fopen(fn, "w+"))) {
                        setlinebuf(f);
-                       fprintf(f, "SERVERCHAN:    %s\n", chan->name);
+                       fprintf(f, "SERVERCHAN:    %s\n", ast_channel_name(chan));
                        fprintf(f, "SERVERTEST ID: %s\n", testid);
                        fprintf(f, "ANSWER:        PASS\n");
                        ast_debug(1, "Processing Test ID '%s'\n", testid);
@@ -463,7 +467,7 @@ static int testserver_exec(struct ast_channel *chan, const char *data)
                } else
                        res = -1;
        } else {
-               ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
+               ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", ast_channel_name(chan));
                res = -1;
        }
        return res;