@ -4906,6 +4906,101 @@ ari_validator ast_ari_validate_channel_talking_started_fn(void)
return ast_ari_validate_channel_talking_started ;
}
int ast_ari_validate_channel_tone_detected ( struct ast_json * json )
{
int res = 1 ;
struct ast_json_iter * iter ;
int has_type = 0 ;
int has_application = 0 ;
int has_timestamp = 0 ;
int has_channel = 0 ;
for ( iter = ast_json_object_iter ( json ) ; iter ; iter = ast_json_object_iter_next ( json , iter ) ) {
if ( strcmp ( " asterisk_id " , ast_json_object_iter_key ( iter ) ) = = 0 ) {
int prop_is_valid ;
prop_is_valid = ast_ari_validate_string (
ast_json_object_iter_value ( iter ) ) ;
if ( ! prop_is_valid ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected field asterisk_id failed validation \n " ) ;
res = 0 ;
}
} else
if ( strcmp ( " type " , ast_json_object_iter_key ( iter ) ) = = 0 ) {
int prop_is_valid ;
has_type = 1 ;
prop_is_valid = ast_ari_validate_string (
ast_json_object_iter_value ( iter ) ) ;
if ( ! prop_is_valid ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected field type failed validation \n " ) ;
res = 0 ;
}
} else
if ( strcmp ( " application " , ast_json_object_iter_key ( iter ) ) = = 0 ) {
int prop_is_valid ;
has_application = 1 ;
prop_is_valid = ast_ari_validate_string (
ast_json_object_iter_value ( iter ) ) ;
if ( ! prop_is_valid ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected field application failed validation \n " ) ;
res = 0 ;
}
} else
if ( strcmp ( " timestamp " , ast_json_object_iter_key ( iter ) ) = = 0 ) {
int prop_is_valid ;
has_timestamp = 1 ;
prop_is_valid = ast_ari_validate_date (
ast_json_object_iter_value ( iter ) ) ;
if ( ! prop_is_valid ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected field timestamp failed validation \n " ) ;
res = 0 ;
}
} else
if ( strcmp ( " channel " , ast_json_object_iter_key ( iter ) ) = = 0 ) {
int prop_is_valid ;
has_channel = 1 ;
prop_is_valid = ast_ari_validate_channel (
ast_json_object_iter_value ( iter ) ) ;
if ( ! prop_is_valid ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected field channel failed validation \n " ) ;
res = 0 ;
}
} else
{
ast_log ( LOG_ERROR ,
" ARI ChannelToneDetected has undocumented field %s \n " ,
ast_json_object_iter_key ( iter ) ) ;
res = 0 ;
}
}
if ( ! has_type ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected missing required field type \n " ) ;
res = 0 ;
}
if ( ! has_application ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected missing required field application \n " ) ;
res = 0 ;
}
if ( ! has_timestamp ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected missing required field timestamp \n " ) ;
res = 0 ;
}
if ( ! has_channel ) {
ast_log ( LOG_ERROR , " ARI ChannelToneDetected missing required field channel \n " ) ;
res = 0 ;
}
return res ;
}
ari_validator ast_ari_validate_channel_tone_detected_fn ( void )
{
return ast_ari_validate_channel_tone_detected ;
}
int ast_ari_validate_channel_unhold ( struct ast_json * json )
{
int res = 1 ;
@ -5867,6 +5962,9 @@ int ast_ari_validate_event(struct ast_json *json)
if ( strcmp ( " ChannelTalkingStarted " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_talking_started ( json ) ;
} else
if ( strcmp ( " ChannelToneDetected " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_tone_detected ( json ) ;
} else
if ( strcmp ( " ChannelUnhold " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_unhold ( json ) ;
} else
@ -6074,6 +6172,9 @@ int ast_ari_validate_message(struct ast_json *json)
if ( strcmp ( " ChannelTalkingStarted " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_talking_started ( json ) ;
} else
if ( strcmp ( " ChannelToneDetected " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_tone_detected ( json ) ;
} else
if ( strcmp ( " ChannelUnhold " , discriminator ) = = 0 ) {
return ast_ari_validate_channel_unhold ( json ) ;
} else