[Freeswitch-svn] [commit] r9284 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Tue Aug 12 14:28:13 EDT 2008


Author: anthm
Date: Tue Aug 12 14:28:13 2008
New Revision: 9284

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c

Log:
add sip-forbid-register to user params to refuse to let a certian user register

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Tue Aug 12 14:28:13 2008
@@ -1273,6 +1273,11 @@
 			const char *var = switch_xml_attr_soft(param, "name");
 			const char *val = switch_xml_attr_soft(param, "value");
 
+			if (!strcasecmp(var, "sip-forbid-register") && switch_true(val)) {
+				ret = AUTH_FORBIDDEN;
+				goto end;
+			}
+
 			if (!strcasecmp(var, "password")) {
 				passwd = val;
 			}
@@ -1292,6 +1297,11 @@
 			const char *var = switch_xml_attr_soft(param, "name");
 			const char *val = switch_xml_attr_soft(param, "value");
 
+			if (!strcasecmp(var, "sip-forbid-register") && switch_true(val)) {
+				ret = AUTH_FORBIDDEN;
+				goto end;
+			}
+
 			if (!strcasecmp(var, "password")) {
 				passwd = val;
 			}



More information about the Freeswitch-svn mailing list