[sr-dev] git:master:486031d1: acc_radius : more logging for radius

Yasin yasin.caner at netgsm.com.tr
Fri Oct 2 18:15:29 CEST 2015


Module: kamailio
Branch: master
Commit: 486031d1023ec453083da218df1a23945f64868f
URL: https://github.com/kamailio/kamailio/commit/486031d1023ec453083da218df1a23945f64868f

Author: Yasin <yasin.caner at netgsm.com.tr>
Committer: Yasin <yasin.caner at netgsm.com.tr>
Date: 2015-10-02T09:52:55+03:00

acc_radius : more logging for radius

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.

---

Modified: modules/acc_radius/acc_radius_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/486031d1023ec453083da218df1a23945f64868f.diff
Patch: https://github.com/kamailio/kamailio/commit/486031d1023ec453083da218df1a23945f64868f.patch

---

diff --git a/modules/acc_radius/acc_radius_mod.c b/modules/acc_radius/acc_radius_mod.c
index f9327ad..3ec064b 100644
--- a/modules/acc_radius/acc_radius_mod.c
+++ b/modules/acc_radius/acc_radius_mod.c
@@ -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 );
@@ -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);




More information about the sr-dev mailing list