@@ -367,11 +367,11 @@ static char *app2 = "OutVerify";
367
367
struct call_verify {
368
368
ast_mutex_t lock ;
369
369
char name [AST_MAX_CONTEXT ]; /*!< Name - Verify section */
370
- int in ; /*!< Total number of incoming calls attempted to verify under this profile */
371
- int insuccess ; /*!< Total number of incoming calls successfully passed verification */
372
- int out ; /*!< Total number of outgoing calls attempted to out verify under this profile */
373
- int outsuccess ; /*!< Total number of outgoing calls out-verified under this profile */
374
- int total_blacklisted ; /*!< Total number of incoming calls that have been rejected due to blacklisting */
370
+ unsigned int in ; /*!< Total number of incoming calls attempted to verify under this profile */
371
+ unsigned int insuccess ; /*!< Total number of incoming calls successfully passed verification */
372
+ unsigned int out ; /*!< Total number of outgoing calls attempted to out verify under this profile */
373
+ unsigned int outsuccess ; /*!< Total number of outgoing calls out-verified under this profile */
374
+ unsigned int total_blacklisted ; /*!< Total number of incoming calls that have been rejected due to blacklisting */
375
375
char verifymethod [PATH_MAX ]; /*!< Algorithm to use for verification: direct or reverse */
376
376
char requestmethod [PATH_MAX ]; /*!< Request method: curl or enum */
377
377
char verifyrequest [PATH_MAX ]; /*!< Request URL or ENUM lookup */
@@ -387,16 +387,9 @@ struct call_verify {
387
387
char token_remote_var [AST_MAX_CONTEXT ]; /*!< Variable in which token may arrive */
388
388
char setinvars [PATH_MAX ]; /*!< Variables to set on incoming call */
389
389
char setoutvars [PATH_MAX ]; /*!< Variables to set on outgoing call */
390
- int sanitychecks ; /*!< Whether or not to do sanity checks on the alleged calling number */
391
- int extendtrust ; /*!< Whether to verify through/via calls */
392
- int allowdisathru ; /*!< Whether to allow DISA thru calls */
393
- int allowpstnthru ; /*!< Whether to allow PSTN thru calls */
394
- int allowtoken ; /*!< Whether to allow verification tokens */
395
- int flagprivateip ; /*!< Whether to flag private IP addresses as malicious */
396
390
char successregex [PATH_MAX ]; /*!< Regex to use for direct verification to determine success */
397
391
char blacklist_endpoint [PATH_MAX ]; /*!< Blacklist endpoint */
398
392
float blacklist_threshold ; /*!< Blacklist threshold */
399
- int blacklist_failopen ; /*!< Allow blacklist to fail open */
400
393
char outregex [PATH_MAX ]; /*!< Regex to use to verify outgoing URIs */
401
394
char exceptioncontext [PATH_MAX ]; /*!< Action to take upon failure */
402
395
char failureaction [PATH_MAX ]; /*!< Action to take upon failure */
@@ -413,6 +406,14 @@ struct call_verify {
413
406
char loglevel [AST_MAX_CONTEXT ]; /*!< Log level */
414
407
char logmsg [PATH_MAX ]; /*!< Log message */
415
408
AST_LIST_ENTRY (call_verify ) entry ; /*!< Next Verify record */
409
+ /* Flags */
410
+ unsigned int sanitychecks :1 ; /*!< Whether or not to do sanity checks on the alleged calling number */
411
+ unsigned int extendtrust :1 ; /*!< Whether to verify through/via calls */
412
+ unsigned int allowdisathru :1 ; /*!< Whether to allow DISA thru calls */
413
+ unsigned int allowpstnthru :1 ; /*!< Whether to allow PSTN thru calls */
414
+ unsigned int allowtoken :1 ; /*!< Whether to allow verification tokens */
415
+ unsigned int flagprivateip :1 ; /*!< Whether to flag private IP addresses as malicious */
416
+ unsigned int blacklist_failopen :1 ; /*!< Allow blacklist to fail open */
416
417
};
417
418
418
419
#define DEFAULT_CURL_TIMEOUT 5
@@ -422,7 +423,7 @@ static int curltimeout = DEFAULT_CURL_TIMEOUT; /*!< Curl Timeout */
422
423
423
424
static AST_RWLIST_HEAD_STATIC (verifys , call_verify ) ;
424
425
425
- char stir_shaken_stats [2 ][6 ];
426
+ unsigned int stir_shaken_stats [2 ][6 ];
426
427
ast_mutex_t ss_lock ;
427
428
428
429
/*! \brief Allocate and initialize verify profile */
@@ -1845,7 +1846,7 @@ static const char *stir_shaken_name(char c)
1845
1846
1846
1847
static char * handle_show_stirshaken (struct ast_cli_entry * e , int cmd , struct ast_cli_args * a )
1847
1848
{
1848
- int total [2 ];
1849
+ unsigned int total [2 ];
1849
1850
char c ;
1850
1851
1851
1852
total [0 ] = total [1 ] = 0 ;
@@ -1863,13 +1864,13 @@ static char *handle_show_stirshaken(struct ast_cli_entry *e, int cmd, struct ast
1863
1864
1864
1865
ast_cli (a -> fd , "%-30s %14s %14s\n" , "STIR/SHAKEN Rating" , "# Direct Calls" , "Passthru Calls" );
1865
1866
for (c = 'A' ; c <= 'F' ; c ++ ) {
1866
- ast_cli (a -> fd , "%-30s %14d %14d \n" , stir_shaken_name (c ), stir_shaken_stats [0 ][c - 'A' ], stir_shaken_stats [1 ][c - 'A' ]);
1867
+ ast_cli (a -> fd , "%-30s %14u %14u \n" , stir_shaken_name (c ), stir_shaken_stats [0 ][c - 'A' ], stir_shaken_stats [1 ][c - 'A' ]);
1867
1868
total [0 ] += stir_shaken_stats [0 ][c - 'A' ];
1868
1869
total [1 ] += stir_shaken_stats [1 ][c - 'A' ];
1869
1870
}
1870
1871
ast_cli (a -> fd , "------------------------------ ----------\n" );
1871
- ast_cli (a -> fd , "%-30s %14d %14d \n" , "Total # STIR/SHAKEN Calls" , total [0 ], total [1 ]);
1872
- ast_cli (a -> fd , "%-30s %14s %14d \n" , "" , "=" , total [0 ] + total [1 ]);
1872
+ ast_cli (a -> fd , "%-30s %14u %14u \n" , "Total # STIR/SHAKEN Calls" , total [0 ], total [1 ]);
1873
+ ast_cli (a -> fd , "%-30s %14s %14u \n" , "" , "=" , total [0 ] + total [1 ]);
1873
1874
1874
1875
return CLI_SUCCESS ;
1875
1876
}
@@ -1878,7 +1879,7 @@ static char *handle_show_stirshaken(struct ast_cli_entry *e, int cmd, struct ast
1878
1879
static char * handle_show_profiles (struct ast_cli_entry * e , int cmd , struct ast_cli_args * a )
1879
1880
{
1880
1881
#define FORMAT "%-20s %-7s %-8s %-10s %-13s %-11s %-9s %-11s %-14s\n"
1881
- #define FORMAT2 "%-20s %7s %8d %10d %13d %11d %9d %11d %14d \n"
1882
+ #define FORMAT2 "%-20s %7s %8u %10u %13u %11u %9u %11u %14u \n"
1882
1883
struct call_verify * v ;
1883
1884
1884
1885
switch (cmd ) {
@@ -1982,10 +1983,10 @@ static char *handle_show_profile(struct ast_cli_entry *e, int cmd, struct ast_cl
1982
1983
ast_cli (a -> fd , FORMAT , "code_spoof" , v -> code_spoof );
1983
1984
ast_cli (a -> fd , FORMAT , "Log Level" , v -> loglevel );
1984
1985
ast_cli (a -> fd , FORMAT , "Log Msg Fmt" , v -> logmsg );
1985
- ast_cli (a -> fd , "%s%d of %d %s incoming calls in profile '%s' have successfully passed verification\n" ,
1986
+ ast_cli (a -> fd , "%s%u of %u %s incoming calls in profile '%s' have successfully passed verification\n" ,
1986
1987
ast_term_color (v -> insuccess == 0 ? COLOR_RED : COLOR_GREEN , COLOR_BLACK ),
1987
1988
v -> insuccess , v -> in , ast_term_reset (), v -> name );
1988
- ast_cli (a -> fd , "%s%d of %d %s outgoing calls in profile '%s' have successfully been out-verified\n" ,
1989
+ ast_cli (a -> fd , "%s%u of %u %s outgoing calls in profile '%s' have successfully been out-verified\n" ,
1989
1990
ast_term_color (v -> outsuccess == 0 ? COLOR_RED : COLOR_GREEN , COLOR_BLACK ),
1990
1991
v -> outsuccess , v -> out , ast_term_reset (), v -> name );
1991
1992
break ;
0 commit comments