@ -62,10 +62,9 @@ ASTERISK_REGISTER_FILE()
static void ast_ari_channels_list_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_list_args args = { } ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -174,11 +173,10 @@ int ast_ari_channels_originate_parse_body(
static void ast_ari_channels_originate_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_originate_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -226,21 +224,6 @@ static void ast_ari_channels_originate_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
args . variables = body ;
ast_ari_channels_originate ( headers , & args , response ) ;
# if defined(AST_DEVMODE)
@ -323,11 +306,10 @@ int ast_ari_channels_create_parse_body(
static void ast_ari_channels_create_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_create_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -357,21 +339,6 @@ static void ast_ari_channels_create_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_create_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -419,11 +386,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_get_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_get_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -535,11 +501,10 @@ int ast_ari_channels_originate_with_id_parse_body(
static void ast_ari_channels_originate_with_id_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_originate_with_id_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -590,21 +555,6 @@ static void ast_ari_channels_originate_with_id_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
args . variables = body ;
ast_ari_channels_originate_with_id ( headers , & args , response ) ;
# if defined(AST_DEVMODE)
@ -663,11 +613,10 @@ int ast_ari_channels_hangup_parse_body(
static void ast_ari_channels_hangup_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_hangup_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -685,21 +634,6 @@ static void ast_ari_channels_hangup_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_hangup_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -773,11 +707,10 @@ int ast_ari_channels_continue_in_dialplan_parse_body(
static void ast_ari_channels_continue_in_dialplan_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_continue_in_dialplan_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -804,21 +737,6 @@ static void ast_ari_channels_continue_in_dialplan_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_continue_in_dialplan_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -881,11 +799,10 @@ int ast_ari_channels_redirect_parse_body(
static void ast_ari_channels_redirect_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_redirect_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -903,21 +820,6 @@ static void ast_ari_channels_redirect_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_redirect_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -969,11 +871,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_answer_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_answer_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1030,11 +931,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_ring_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_ring_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1091,11 +991,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_ring_stop_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_ring_stop_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1181,11 +1080,10 @@ int ast_ari_channels_send_dtmf_parse_body(
static void ast_ari_channels_send_dtmf_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_send_dtmf_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1215,21 +1113,6 @@ static void ast_ari_channels_send_dtmf_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_send_dtmf_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -1293,11 +1176,10 @@ int ast_ari_channels_mute_parse_body(
static void ast_ari_channels_mute_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_mute_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1315,21 +1197,6 @@ static void ast_ari_channels_mute_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_mute_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -1392,11 +1259,10 @@ int ast_ari_channels_unmute_parse_body(
static void ast_ari_channels_unmute_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_unmute_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1414,21 +1280,6 @@ static void ast_ari_channels_unmute_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_unmute_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -1478,11 +1329,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_hold_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_hold_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1539,11 +1389,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_unhold_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_unhold_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1613,11 +1462,10 @@ int ast_ari_channels_start_moh_parse_body(
static void ast_ari_channels_start_moh_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_start_moh_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1635,21 +1483,6 @@ static void ast_ari_channels_start_moh_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_start_moh_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -1699,11 +1532,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_stop_moh_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_stop_moh_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1760,11 +1592,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_start_silence_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_start_silence_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1821,11 +1652,10 @@ fin: __attribute__((unused))
static void ast_ari_channels_stop_silence_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_stop_silence_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -1936,11 +1766,10 @@ int ast_ari_channels_play_parse_body(
static void ast_ari_channels_play_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_play_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2010,21 +1839,6 @@ static void ast_ari_channels_play_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_play_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2126,11 +1940,10 @@ int ast_ari_channels_play_with_id_parse_body(
static void ast_ari_channels_play_with_id_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_play_with_id_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2200,21 +2013,6 @@ static void ast_ari_channels_play_with_id_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_play_with_id_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2303,11 +2101,10 @@ int ast_ari_channels_record_parse_body(
static void ast_ari_channels_record_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_record_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2343,21 +2140,6 @@ static void ast_ari_channels_record_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_record_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2421,11 +2203,10 @@ int ast_ari_channels_get_channel_var_parse_body(
static void ast_ari_channels_get_channel_var_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_get_channel_var_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2443,21 +2224,6 @@ static void ast_ari_channels_get_channel_var_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_get_channel_var_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2524,11 +2290,10 @@ int ast_ari_channels_set_channel_var_parse_body(
static void ast_ari_channels_set_channel_var_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_set_channel_var_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2549,21 +2314,6 @@ static void ast_ari_channels_set_channel_var_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_set_channel_var_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2642,11 +2392,10 @@ int ast_ari_channels_snoop_channel_parse_body(
static void ast_ari_channels_snoop_channel_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_snoop_channel_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2676,21 +2425,6 @@ static void ast_ari_channels_snoop_channel_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_snoop_channel_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2764,11 +2498,10 @@ int ast_ari_channels_snoop_channel_with_id_parse_body(
static void ast_ari_channels_snoop_channel_with_id_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_snoop_channel_with_id_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2798,21 +2531,6 @@ static void ast_ari_channels_snoop_channel_with_id_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_snoop_channel_with_id_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;
@ -2878,11 +2596,10 @@ int ast_ari_channels_dial_parse_body(
static void ast_ari_channels_dial_cb (
struct ast_tcptls_session_instance * ser ,
struct ast_variable * get_params , struct ast_variable * path_vars ,
struct ast_variable * headers , struct ast_ ari_response * response )
struct ast_variable * headers , struct ast_ json * body , struct ast_ ari_response * response )
{
struct ast_ari_channels_dial_args args = { } ;
struct ast_variable * i ;
RAII_VAR ( struct ast_json * , body , NULL , ast_json_unref ) ;
# if defined(AST_DEVMODE)
int is_valid ;
int code ;
@ -2903,21 +2620,6 @@ static void ast_ari_channels_dial_cb(
} else
{ }
}
/* Look for a JSON request entity */
body = ast_http_get_json ( ser , headers ) ;
if ( ! body ) {
switch ( errno ) {
case EFBIG :
ast_ari_response_error ( response , 413 , " Request Entity Too Large " , " Request body too large " ) ;
goto fin ;
case ENOMEM :
ast_ari_response_error ( response , 500 , " Internal Server Error " , " Error processing request " ) ;
goto fin ;
case EIO :
ast_ari_response_error ( response , 400 , " Bad Request " , " Error parsing request body " ) ;
goto fin ;
}
}
if ( ast_ari_channels_dial_parse_body ( body , & args ) ) {
ast_ari_response_alloc_failed ( response ) ;
goto fin ;