|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2022 Simples IP. |
|
|
|
|
* Author: Ródgger Bruno <rodgger.silva@simplesip.com> |
|
|
|
|
* Maintainers: Ródgger Bruno <rodgger.silva@simplesip.com> |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include <ami.h> |
|
|
|
@ -20,6 +20,7 @@ void parse_response(AMI *ami, const char *buffer, int *incomplete){
|
|
|
|
|
ACTION *p_action = NULL; |
|
|
|
|
size_t len_command = 0; |
|
|
|
|
const char *privilege = NULL; |
|
|
|
|
int count = 0; |
|
|
|
|
|
|
|
|
|
p_end = strstr(buffer, end_response); |
|
|
|
|
if( !p_end ){ |
|
|
|
@ -40,6 +41,7 @@ void parse_response(AMI *ami, const char *buffer, int *incomplete){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(buffer < p_end){ |
|
|
|
|
count++; |
|
|
|
|
ARGS *arg = ami_arg_create(); |
|
|
|
|
|
|
|
|
|
// argumento key
|
|
|
|
@ -78,7 +80,7 @@ void parse_response(AMI *ami, const char *buffer, int *incomplete){
|
|
|
|
|
arg->value = calloc(1, len_command + 1 ); |
|
|
|
|
strncpy(arg->value, buffer, len_command); |
|
|
|
|
arg->value[len_command] = '\0'; |
|
|
|
|
ami_args_add(&p_response->args, arg); |
|
|
|
|
ami_args_add( &p_response->args, arg ); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -88,6 +90,8 @@ void parse_response(AMI *ami, const char *buffer, int *incomplete){
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
p_action->response->count = count; |
|
|
|
|
|
|
|
|
|
pthread_mutex_lock(&ami->thread.mutex_actions); |
|
|
|
|
if( !strcmp( p_action->actionid, "_LOGIN_" ) ) { |
|
|
|
|
if( !strcasecmp(p_action->response->response, "Success") ) { |
|
|
|
|