Make SIP tests compile again.
[asterisk/asterisk.git] / channels / sip / dialplan_functions.c
index 297f9f5..d39a277 100644 (file)
@@ -91,8 +91,9 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p
                else
                        return -1;
 
+               /* Return 0 to suppress a console warning message */
                if (!stream) {
-                       return -1;
+                       return 0;
                }
 
                ast_rtp_instance_get_remote_address(stream, &sin);
@@ -113,8 +114,9 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p
                else
                        return -1;
 
+               /* Return 0 to suppress a console warning message */
                if (!stream) {
-                       return -1;
+                       return 0;
                }
 
                ast_rtp_instance_get_local_address(stream, &sin);
@@ -165,8 +167,8 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p
                        } lookup[] = {
                                { "txcount",               INT, { .i4 = &stats.txcount, }, },
                                { "rxcount",               INT, { .i4 = &stats.rxcount, }, },
-                               { "txjitter",              INT, { .i4 = &stats.txjitter, }, },
-                               { "rxjitter",              INT, { .i4 = &stats.rxjitter, }, },
+                               { "txjitter",              DBL, { .d8 = &stats.txjitter, }, },
+                               { "rxjitter",              DBL, { .d8 = &stats.rxjitter, }, },
                                { "remote_maxjitter",      DBL, { .d8 = &stats.remote_maxjitter, }, },
                                { "remote_minjitter",      DBL, { .d8 = &stats.remote_minjitter, }, },
                                { "remote_normdevjitter",  DBL, { .d8 = &stats.remote_normdevjitter, }, },
@@ -185,7 +187,7 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p
                                { "local_minrxploss",      DBL, { .d8 = &stats.local_minrxploss, }, },
                                { "local_normdevrxploss",  DBL, { .d8 = &stats.local_normdevrxploss, }, },
                                { "local_stdevrxploss",    DBL, { .d8 = &stats.local_stdevrxploss, }, },
-                               { "rtt",                   INT, { .i4 = &stats.rtt, }, },
+                               { "rtt",                   DBL, { .d8 = &stats.rtt, }, },
                                { "maxrtt",                DBL, { .d8 = &stats.maxrtt, }, },
                                { "minrtt",                DBL, { .d8 = &stats.minrtt, }, },
                                { "normdevrtt",            DBL, { .d8 = &stats.normdevrtt, }, },
@@ -262,7 +264,7 @@ AST_TEST_DEFINE(test_sip_rtpqos_1)
                .write = test_sip_rtpqos_1_write,
                .get_stat = test_sip_rtpqos_1_get_stat,
        };
-       struct sockaddr_in sin = { .sin_port = 31337, .sin_addr = { 4 * 16777216 + 3 * 65536 + 2 * 256 + 1 } };
+       struct sockaddr_in sin = { .sin_port = 31337, .sin_addr = { .s_addr = 4 * 16777216 + 3 * 65536 + 2 * 256 + 1 } };
        struct ast_rtp_instance_stats mine = { 0, };
        struct sip_pvt *p = NULL;
        struct ast_channel *chan = NULL;
@@ -277,8 +279,8 @@ AST_TEST_DEFINE(test_sip_rtpqos_1)
        } lookup[] = {
                { "txcount",               INT, { .i4 = &mine.txcount, }, },
                { "rxcount",               INT, { .i4 = &mine.rxcount, }, },
-               { "txjitter",              INT, { .i4 = &mine.txjitter, }, },
-               { "rxjitter",              INT, { .i4 = &mine.rxjitter, }, },
+               { "txjitter",              DBL, { .d8 = &mine.txjitter, }, },
+               { "rxjitter",              DBL, { .d8 = &mine.rxjitter, }, },
                { "remote_maxjitter",      DBL, { .d8 = &mine.remote_maxjitter, }, },
                { "remote_minjitter",      DBL, { .d8 = &mine.remote_minjitter, }, },
                { "remote_normdevjitter",  DBL, { .d8 = &mine.remote_normdevjitter, }, },
@@ -297,7 +299,7 @@ AST_TEST_DEFINE(test_sip_rtpqos_1)
                { "local_minrxploss",      DBL, { .d8 = &mine.local_minrxploss, }, },
                { "local_normdevrxploss",  DBL, { .d8 = &mine.local_normdevrxploss, }, },
                { "local_stdevrxploss",    DBL, { .d8 = &mine.local_stdevrxploss, }, },
-               { "rtt",                   INT, { .i4 = &mine.rtt, }, },
+               { "rtt",                   DBL, { .d8 = &mine.rtt, }, },
                { "maxrtt",                DBL, { .d8 = &mine.maxrtt, }, },
                { "minrtt",                DBL, { .d8 = &mine.minrtt, }, },
                { "normdevrtt",            DBL, { .d8 = &mine.normdevrtt, }, },