Skip to content

Commit

Permalink
acc_radius : more logging for radius
Browse files Browse the repository at this point in the history
added more log about radius result. it makes better to understand problem. i checked freeradiusclient.h and radiusclient-ng.h to have all defined variables.
  • Loading branch information
Yasin committed Oct 2, 2015
1 parent 369f79b commit 486031d
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions modules/acc_radius/acc_radius_mod.c
Expand Up @@ -327,7 +327,8 @@ int acc_radius_send_request(struct sip_msg *req, acc_info_t *inf)
int i;
int m=0;
int o=0;

int rc_result=-1;

send=NULL;

attr_cnt = accb.get_core_attrs( req, inf->varr, inf->iarr, inf->tarr );
Expand Down Expand Up @@ -384,14 +385,28 @@ int acc_radius_send_request(struct sip_msg *req, acc_info_t *inf)
inf->tarr, 0))!=0 );
}

if (rc_acct(rh, SIP_PORT, send)!=OK_RC) {
LM_ERR("radius-ing failed\n");
goto error;
}
rc_avpair_free(send);
/* free memory allocated by extra2strar */
free_strar_mem( &(inf->tarr[m-o]), &(inf->varr[m-o]), o, m);
return 1;
rc_result=rc_acct(rh, SIP_PORT, send);

if (rc_result==ERROR_RC) {
LM_ERR("Radius accounting - ERROR - \n");
goto error;
}else if(rc_result==BADRESP_RC){
LM_ERR("Radius accounting - BAD RESPONSE \n");
goto error;
}else if(rc_result==TIMEOUT_RC){
LM_ERR("Radius accounting - TIMEOUT \n");
goto error;
}else if(rc_result==REJECT_RC){
LM_ERR("Radius accounting - REJECTED \n");
goto error;
}else if(rc_result==OK_RC){
LM_DBG("Radius accounting - OK \n");
}

rc_avpair_free(send);
/* free memory allocated by extra2strar */
free_strar_mem( &(inf->tarr[m-o]), &(inf->varr[m-o]), o, m);
return 1;

error:
rc_avpair_free(send);
Expand Down

0 comments on commit 486031d

Please sign in to comment.