Bläddra i källkod

pua_usrloc: replace STR_PARAM with PARAM_STR

Alekzander Spiridonov 11 år sedan
förälder
incheckning
1bac69c812
1 ändrade filer med 6 tillägg och 11 borttagningar
  1. 6 11
      modules/pua_usrloc/pua_usrloc.c

+ 6 - 11
modules/pua_usrloc/pua_usrloc.c

@@ -58,14 +58,14 @@
 
 MODULE_VERSION
 
-str default_domain= {NULL, 0};
+str default_domain= STR_NULL;
 
 int pua_ul_publish = 0;
 int pua_ul_bflag = -1;
 int pua_ul_bmask = 0;
 
 pua_api_t pua;
-str pres_prefix= {0, 0};
+str pres_prefix= STR_NULL;
 
 /*! \brief Structure containing pointers to usrloc functions */
 usrloc_api_t ul;
@@ -87,8 +87,8 @@ static cmd_export_t cmds[]=
 };
 
 static param_export_t params[]={
-	{"default_domain",	 STR_PARAM, &default_domain.s	 },
-	{"entity_prefix",	 STR_PARAM, &pres_prefix.s		 },
+	{"default_domain",	 PARAM_STR, &default_domain	 },
+	{"entity_prefix",	 PARAM_STR, &pres_prefix		 },
 	{"branch_flag",	     INT_PARAM, &pua_ul_bflag		 },
 	{0,							 0,			0            }
 };
@@ -116,19 +116,14 @@ static int mod_init(void)
 	bind_usrloc_t bind_usrloc;
 	bind_pua_t bind_pua;
 	
-	if(default_domain.s == NULL )
+	if(!default_domain.s || default_domain.len<=0)
 	{	
 		LM_ERR("default domain parameter not set\n");
 		return -1;
 	}
-	default_domain.len= strlen(default_domain.s);
 	
-	if(pres_prefix.s == NULL )
-	{	
+	if(!pres_prefix.s || pres_prefix.len<=0)
 		LM_DBG("No pres_prefix configured\n");
-	}
-	else
-		pres_prefix.len= strlen(pres_prefix.s);
 
 	bind_usrloc = (bind_usrloc_t)find_export("ul_bind_usrloc", 1, 0);
 	if (!bind_usrloc)