浏览代码

misc_radius: new parameter common_response

- get the radius response specific attributes in avps
- patch by Victor V. Kustov
Daniel-Constantin Mierla 12 年之前
父节点
当前提交
0eb9ef443d
共有 3 个文件被更改,包括 502 次插入437 次删除
  1. 488 426
      modules/misc_radius/functions.c
  2. 13 11
      modules/misc_radius/misc_radius.c
  3. 1 0
      modules/misc_radius/misc_radius.h

文件差异内容过多而无法显示
+ 488 - 426
modules/misc_radius/functions.c


+ 13 - 11
modules/misc_radius/misc_radius.c

@@ -57,6 +57,7 @@ static int caller_service_type = -1;
 static int callee_service_type = -1;
 static int group_service_type = -1;
 static int uri_service_type = -1;
+int common_response = 0;
 int use_sip_uri_host = 0;
 
 void *rh;
@@ -117,7 +118,8 @@ static param_export_t params[] = {
     {"callee_extra",        STR_PARAM, &callee_extra_str   },
     {"group_extra",         STR_PARAM, &group_extra_str    },
     {"uri_extra",           STR_PARAM, &uri_extra_str      },
-    {"use_sip_uri_host",    INT_PARAM, &use_sip_uri_host},
+    {"use_sip_uri_host",    INT_PARAM, &use_sip_uri_host   },
+    {"common_response",     INT_PARAM, &common_response    },
     {0, 0, 0}
 };	
 
@@ -139,19 +141,19 @@ struct module_exports exports = {
 
 
 /* Macro to set static attribute names */
-#define SET_STATIC(_attrs)		\
-    do {								\
+#define SET_STATIC(_attrs)		                        \
+    do {								                \
 	memset((_attrs), 0, sizeof((_attrs)));				\
-	(_attrs)[SA_SERVICE_TYPE].n	   = "Service-Type";		\
+	(_attrs)[SA_SERVICE_TYPE].n	   = "Service-Type";	\
 	(_attrs)[SA_USER_NAME].n	   = "User-Name";		\
-	(_attrs)[SA_SIP_AVP].n	           = "SIP-AVP";			\
+	(_attrs)[SA_SIP_AVP].n	       = "SIP-AVP";			\
 	(_attrs)[SA_SIP_GROUP].n	   = "SIP-Group";		\
-	if (use_sip_uri_host) {						\
-	    (_attrs)[SA_SIP_URI_HOST].n	   = "SIP-URI-Host";		\
-	} else {							\
-	    (_attrs)[SA_SIP_URI_HOST].n	   = "User-Name";		\
-	}								\
-	n = SA_STATIC_MAX;						\
+	if (use_sip_uri_host) {						        \
+	    (_attrs)[SA_SIP_URI_HOST].n  = "SIP-URI-Host";  \
+	} else {							                \
+	    (_attrs)[SA_SIP_URI_HOST].n  = "User-Name";     \
+	}								                    \
+	n = SA_STATIC_MAX;						            \
     }while(0)
 
 

+ 1 - 0
modules/misc_radius/misc_radius.h

@@ -35,6 +35,7 @@ enum {GV_GROUP_CHECK = 0, GV_STATIC_MAX};
 enum {UV_CALL_CHECK = 0, UV_STATIC_MAX};
 
 extern int use_sip_uri_host;
+extern int common_response;
 
 extern void *rh;
 

部分文件因为文件数量过多而无法显示