Browse code

registrar: use macro to init str value and more debug messages

Daniel-Constantin Mierla authored on 18/08/2022 09:52:51
Showing 1 changed files
... ...
@@ -432,12 +432,14 @@ int reg_get_crt_max_contacts(void)
432 432
 {
433 433
 	int n;
434 434
 	sr_xavp_t *vavp=NULL;
435
-	str vname = {"max_contacts", 12};
435
+	str vname = str_init("max_contacts");
436 436
 
437 437
 	n = 0;
438 438
 
439 439
 	if(reg_xavp_cfg.s!=NULL)
440 440
 	{
441
+		LM_DBG("looking up $xavp(%.*s=>%.*s) for max contacts limit\n",
442
+				reg_xavp_cfg.len, reg_xavp_cfg.s, vname.len, vname.s);
441 443
 		vavp = xavp_get_child_with_ival(&reg_xavp_cfg, &vname);
442 444
 		if(vavp!=NULL)
443 445
 		{
... ...
@@ -506,8 +508,8 @@ static inline int insert_contacts(struct sip_msg* _m, udomain_t* _d, str* _a,
506 508
 
507 509
 
508 510
 		if (maxc > 0 && num >= maxc) {
509
-			LM_INFO("too many contacts (%d) for AOR <%.*s>\n",
510
-					num, _a->len, _a->s);
511
+			LM_INFO("too many contacts (n:%d max:%d) for AOR <%.*s>\n",
512
+					num, maxc, _a->len, _a->s);
511 513
 			rerrno = R_TOO_MANY;
512 514
 			goto error;
513 515
 		}
... ...
@@ -573,7 +575,7 @@ static inline int insert_contacts(struct sip_msg* _m, udomain_t* _d, str* _a,
573 575
 	} else { /* No contacts found */
574 576
 		build_contact(_m, NULL, &u->host);
575 577
 	}
576
-	
578
+
577 579
 #ifdef USE_TCP
578 580
 	if ( tcp_check && e_max>0 ) {
579 581
 		e_max -= act_time;