Browse code

modules_k/rls: Fixed some DB handling stuff

- Removed the (unnecessary) rls_db2 connection
- Close the XCAP database connection in destroy()

pd authored on 24/01/2012 17:23:47
Showing 2 changed files
... ...
@@ -67,8 +67,6 @@ db1_con_t *rls_db = NULL;
67 67
 db_func_t rls_dbf;
68 68
 db1_con_t *rls_xcap_db = NULL;
69 69
 db_func_t rls_xcap_dbf;
70
-db1_con_t *rls2_db = NULL;
71
-db_func_t rls2_dbf;
72 70
 
73 71
 /** modules variables */
74 72
 str rls_server_address = {0, 0};
... ...
@@ -224,7 +222,7 @@ static param_export_t params[]={
224 222
 	{ "rls_event",              STR_PARAM|USE_FUNC_PARAM,(void*)add_rls_event},
225 223
 	{ "outbound_proxy",         STR_PARAM,   &rls_outbound_proxy.s           },
226 224
 	{ "reload_db_subs",         INT_PARAM,   &rls_reload_db_subs             },
227
-	{ "max_notify_body_length", INT_PARAM,	 &rls_max_notify_body_len	     },
225
+	{ "max_notify_body_length", INT_PARAM,	 &rls_max_notify_body_len	 },
228 226
 	{ "db_mode",                INT_PARAM,	 &dbmode                         },
229 227
 	{ "expires_offset",         INT_PARAM,	 &rls_expires_offset             },
230 228
 	{ "fetch_rows",             INT_PARAM,   &rls_fetch_rows                 },
... ...
@@ -400,15 +398,6 @@ static int mod_init(void)
400 398
 	
401 399
 	/* binding to mysql module  */
402 400
 
403
-	/* rls2_db handle is to ensure that there are no unwanted interactions
404
-	   between the original database reads and the DB_ONLY mode stuff */
405
-
406
-	if (db_bind_mod(&db_url, &rls2_dbf))
407
-	{
408
-		LM_ERR("Database module not found\n");
409
-		return -1;
410
-	}
411
-
412 401
 	if (db_bind_mod(&db_url, &rls_dbf))
413 402
 	{
414 403
 		LM_ERR("Database module not found\n");
... ...
@@ -492,7 +481,6 @@ static int mod_init(void)
492 481
 		rls_xcap_dbf.close(rls_xcap_db);
493 482
 	rls_xcap_db = NULL;
494 483
 
495
-
496 484
 	if(waitn_time<= 0)
497 485
 		waitn_time= 5;
498 486
 
... ...
@@ -511,7 +499,7 @@ static int mod_init(void)
511 499
 	XMLNodeGetAttrContentByName= libxml_api.xmlNodeGetAttrContentByName;
512 500
 	XMLDocGetNodeByName= libxml_api.xmlDocGetNodeByName;
513 501
 	XMLNodeGetNodeByName= libxml_api.xmlNodeGetNodeByName;
514
-    XMLNodeGetNodeContentByName= libxml_api.xmlNodeGetNodeContentByName;
502
+	XMLNodeGetNodeContentByName= libxml_api.xmlNodeGetNodeContentByName;
515 503
 
516 504
 	if(XMLNodeGetAttrContentByName== NULL || XMLDocGetNodeByName== NULL ||
517 505
 			XMLNodeGetNodeByName== NULL || XMLNodeGetNodeContentByName== NULL)
... ...
@@ -602,69 +590,45 @@ static int child_init(int rank)
602 590
 
603 591
 	LM_DBG("child [%d]  pid [%d]\n", rank, getpid());
604 592
 
605
-	if (rls2_dbf.init==0)
593
+	if (rls_dbf.init==0)
606 594
 	{
607 595
 		LM_CRIT("database not bound\n");
608 596
 		return -1;
609 597
 	}
610
-	rls2_db = rls2_dbf.init(&db_url);
611
-	if (!rls2_db)
598
+	rls_db = rls_dbf.init(&db_url);
599
+	if (!rls_db)
612 600
 	{
613 601
 		LM_ERR("child %d: Error while connecting database\n",
614 602
 				rank);
615 603
 		return -1;
616 604
 	}
617
-	if (rls2_dbf.use_table(rls2_db, &rlsubs_table) < 0)  
618
-	{
619
-		LM_ERR("child %d: Error in use_table rlsubs_table\n", rank);
620
-		return -1;
621
-	}
622
-
623
-	if (rls_xcap_dbf.init==0)
624
-	{
625
-		LM_CRIT("database not bound\n");
626
-		return -1;
627
-	}
628
-
629
-	rls_xcap_db = rls_xcap_dbf.init(&xcap_db_url);
630
-	if (!rls_xcap_db)
631
-	{
632
-		LM_ERR("child %d: Error while connecting database\n", rank);
633
-		return -1;
634
-	}
635 605
 	else
636 606
 	{
637
-		if (rls_xcap_dbf.use_table(rls_xcap_db, &rls_xcap_table) < 0)  
607
+		if (rls_dbf.use_table(rls_db, &rlsubs_table) < 0)  
638 608
 		{
639
-			LM_ERR("child %d: Error in use_table rls_xcap_table\n", rank);
609
+			LM_ERR("child %d: Error in use_table rlsubs_table\n", rank);
640 610
 			return -1;
641 611
 		}
642 612
 
643 613
 		LM_DBG("child %d: Database connection opened successfully\n", rank);
644 614
 	}
645 615
 
646
-	if (rls_dbf.init==0)
616
+	if (rls_xcap_dbf.init==0)
647 617
 	{
648 618
 		LM_CRIT("database not bound\n");
649 619
 		return -1;
650 620
 	}
651
-	rls_db = rls_dbf.init(&db_url);
652
-	if (!rls_db)
621
+	rls_xcap_db = rls_xcap_dbf.init(&xcap_db_url);
622
+	if (!rls_xcap_db)
653 623
 	{
654
-		LM_ERR("child %d: Error while connecting database\n",
655
-				rank);
624
+		LM_ERR("child %d: Error while connecting database\n", rank);
656 625
 		return -1;
657 626
 	}
658 627
 	else
659 628
 	{
660
-		if (rls_dbf.use_table(rls_db, &rlsubs_table) < 0)  
661
-		{
662
-			LM_ERR("child %d: Error in use_table rlsubs_table\n", rank);
663
-			return -1;
664
-		}
665
-		if (rls_dbf.use_table(rls_db, &rlpres_table) < 0)  
629
+		if (rls_xcap_dbf.use_table(rls_xcap_db, &rls_xcap_table) < 0)  
666 630
 		{
667
-			LM_ERR("child %d: Error in use_table rlpres_table\n", rank);
631
+			LM_ERR("child %d: Error in use_table rls_xcap_table\n", rank);
668 632
 			return -1;
669 633
 		}
670 634
 
... ...
@@ -690,9 +654,8 @@ static void destroy(void)
690 654
 	}
691 655
 	if(rls_db && rls_dbf.close)
692 656
 		rls_dbf.close(rls_db);
693
-
694
-	if(rls2_db && rls2_dbf.close)
695
-		rls2_dbf.close(rls2_db);
657
+	if(rls_xcap_db && rls_xcap_dbf.close)
658
+		rls_xcap_dbf.close(rls_xcap_db);
696 659
 
697 660
 	if (rls_update_subs_lock != NULL)
698 661
 	{
... ...
@@ -45,8 +45,8 @@
45 45
 	} while(0);
46 46
 
47 47
 /* database connection */
48
-extern db1_con_t *rls2_db;
49
-extern db_func_t rls2_dbf;
48
+extern db1_con_t *rls_db;
49
+extern db_func_t rls_dbf;
50 50
 
51 51
 extern void update_a_sub(subs_t *subs_copy );
52 52
 
... ...
@@ -123,13 +123,13 @@ int delete_expired_subs_rlsdb( void )
123 123
 
124 124
 	if (rlsdb_debug) LM_ERR( "delete_expired_subs_rlsdb\n" );
125 125
 
126
-	if(rls2_db == NULL)
126
+	if(rls_db == NULL)
127 127
 	{
128 128
 		LM_ERR("null database connection\n");
129 129
 		return(-1);
130 130
 	}
131 131
 
132
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
132
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
133 133
 	{
134 134
 		LM_ERR("use table failed\n");
135 135
 		return(-1);
... ...
@@ -141,7 +141,7 @@ int delete_expired_subs_rlsdb( void )
141 141
 	query_ops[expires_col]= OP_LT;
142 142
 	n_query_cols++;
143 143
 
144
-	rval=rls2_dbf.delete(rls2_db, query_cols, query_ops, query_vals, n_query_cols);
144
+	rval=rls_dbf.delete(rls_db, query_cols, query_ops, query_vals, n_query_cols);
145 145
 
146 146
 	if (rval < 0)
147 147
 	{
... ...
@@ -172,13 +172,13 @@ int delete_rlsdb( str *callid, str *to_tag, str *from_tag )
172 172
 		to_tag?to_tag->len:0, to_tag?to_tag->s:"",
173 173
 		from_tag?from_tag->len:0, from_tag?from_tag->s:"" ); 
174 174
 
175
-	if(rls2_db == NULL)
175
+	if(rls_db == NULL)
176 176
 	{
177 177
 		LM_ERR("null database connection\n");
178 178
 		return(-1);
179 179
 	}
180 180
 
181
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
181
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
182 182
 	{
183 183
 		LM_ERR("use table failed\n");
184 184
 		return(-1);
... ...
@@ -211,7 +211,7 @@ int delete_rlsdb( str *callid, str *to_tag, str *from_tag )
211 211
 		n_query_cols++;
212 212
 	}
213 213
 
214
-	rval = rls2_dbf.delete(rls2_db, query_cols, 0, query_vals, n_query_cols);
214
+	rval = rls_dbf.delete(rls_db, query_cols, 0, query_vals, n_query_cols);
215 215
 
216 216
 	if (rval < 0)
217 217
 	{
... ...
@@ -247,13 +247,13 @@ int update_rlsdb( subs_t *subs, int type)
247 247
 
248 248
 	if (subs==NULL) return(-1);
249 249
 
250
-	if(rls2_db == NULL)
250
+	if(rls_db == NULL)
251 251
 	{
252 252
 		LM_ERR("null database connection\n");
253 253
 		return(-1);
254 254
 	}
255 255
 
256
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
256
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
257 257
 	{
258 258
 		LM_ERR("use table failed\n");
259 259
 		return(-1);
... ...
@@ -301,11 +301,11 @@ int update_rlsdb( subs_t *subs, int type)
301 301
 		int nr_rows;
302 302
 
303 303
 	
304
-		if(rls2_dbf.query(rls2_db, query_cols, 0, query_vals, result_cols, 
304
+		if(rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols, 
305 305
 				n_query_cols, 1, 0, &result )< 0)
306 306
 		{
307 307
 			LM_ERR("Can't query db\n");
308
-			if(result) rls2_dbf.free_result(rls2_db, result);
308
+			if(result) rls_dbf.free_result(rls_db, result);
309 309
 			return(-1);
310 310
 		}
311 311
 
... ...
@@ -317,14 +317,14 @@ int update_rlsdb( subs_t *subs, int type)
317 317
 		{
318 318
 			/* no match */ 
319 319
 			LM_ERR( "update_rlsdb: NO MATCH\n" );
320
-			rls2_dbf.free_result(rls2_db, result);
320
+			rls_dbf.free_result(rls_db, result);
321 321
 			return(-1);
322 322
 		}
323 323
 
324 324
 		if (nr_rows != 1)
325 325
 		{
326 326
 			LM_ERR( "update_rlsdb: TOO MANY MATCHES=%d\n", nr_rows);
327
-			rls2_dbf.free_result(rls2_db, result);
327
+			rls_dbf.free_result(rls_db, result);
328 328
 			return(-1);
329 329
 		}
330 330
 
... ...
@@ -334,7 +334,7 @@ int update_rlsdb( subs_t *subs, int type)
334 334
 		values = ROW_VALUES(rows);
335 335
 
336 336
 		retrieved_local_cseq = VAL_INT(values);
337
-		rls2_dbf.free_result(rls2_db, result);
337
+		rls_dbf.free_result(rls_db, result);
338 338
 
339 339
 		subs->local_cseq = ++retrieved_local_cseq;
340 340
 		data_cols[local_cseq_col= n_data_cols]=&str_local_cseq_col;
... ...
@@ -379,7 +379,7 @@ int update_rlsdb( subs_t *subs, int type)
379 379
 	data_vals[db_flag_col].val.int_val= subs->db_flag;
380 380
 	n_data_cols++;*/
381 381
 
382
-	if(rls2_dbf.update(rls2_db, query_cols, 0, query_vals,
382
+	if(rls_dbf.update(rls_db, query_cols, 0, query_vals,
383 383
                     data_cols,data_vals,n_query_cols,n_data_cols) < 0)
384 384
 	{
385 385
 		LM_ERR("Failed update db\n");
... ...
@@ -423,13 +423,13 @@ int update_all_subs_rlsdb( str *from_user, str *from_domain, str *evt )
423 423
 		from_domain?from_domain->len:0, from_domain?from_domain->s:"",
424 424
 		evt?evt->len:0, evt?evt->s:"" );
425 425
 
426
-	if(rls2_db == NULL)
426
+	if(rls_db == NULL)
427 427
 	{
428 428
 		LM_ERR("null database connection\n");
429 429
 		return(-1);
430 430
 	}
431 431
 
432
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
432
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
433 433
 	{
434 434
 		LM_ERR("use table failed\n");
435 435
 		return(-1);
... ...
@@ -476,11 +476,11 @@ int update_all_subs_rlsdb( str *from_user, str *from_domain, str *evt )
476 476
 	result_cols[r_expires_col=n_result_cols++] = &str_expires_col;
477 477
 
478 478
 
479
-	if(rls2_dbf.query(rls2_db, query_cols, 0, query_vals, result_cols, 
479
+	if(rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols, 
480 480
 				n_query_cols, n_result_cols, 0, &result )< 0)
481 481
 	{
482 482
 		LM_ERR("Can't query db\n");
483
-		if(result) rls2_dbf.free_result(rls2_db, result);
483
+		if(result) rls_dbf.free_result(rls_db, result);
484 484
 		return(-1);
485 485
 	}
486 486
 
... ...
@@ -516,7 +516,7 @@ int update_all_subs_rlsdb( str *from_user, str *from_domain, str *evt )
516 516
 		{
517 517
 			LM_ERR( "Can't allocate memory\n" );
518 518
 			/* tidy up and return >>>>>>>>>>>>>>>>>>>> */
519
-			rls2_dbf.free_result(rls2_db, result);
519
+			rls_dbf.free_result(rls_db, result);
520 520
 			return(-1);
521 521
 		}
522 522
 		memset(dest, 0, size);
... ...
@@ -564,7 +564,7 @@ int update_all_subs_rlsdb( str *from_user, str *from_domain, str *evt )
564 564
 		update_a_sub(dest);
565 565
 	}
566 566
 
567
-	rls2_dbf.free_result(rls2_db, result);
567
+	rls_dbf.free_result(rls_db, result);
568 568
 	if (rlsdb_debug) LM_ERR( "Done\n" );
569 569
 	return(1);	
570 570
 }
... ...
@@ -593,13 +593,13 @@ int update_subs_rlsdb( subs_t *subs )
593 593
 
594 594
 	if (subs==NULL) return(-1);
595 595
 
596
-	if(rls2_db == NULL)
596
+	if(rls_db == NULL)
597 597
 	{
598 598
 		LM_ERR("null database connection\n");
599 599
 		return(-1);
600 600
 	}
601 601
 
602
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
602
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
603 603
 	{
604 604
 		LM_ERR("use table failed\n");
605 605
 		return(-1);
... ...
@@ -629,11 +629,11 @@ int update_subs_rlsdb( subs_t *subs )
629 629
 	result_cols[n_result_cols++] = &str_presentity_uri_col;
630 630
 	result_cols[n_result_cols++] = &str_record_route_col;
631 631
 
632
-	if(rls2_dbf.query(rls2_db, query_cols, 0, query_vals, result_cols, 
632
+	if(rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols, 
633 633
 				n_query_cols, n_result_cols, 0, &result )< 0)
634 634
 	{
635 635
 		LM_ERR("Can't query db\n");
636
-		if(result) rls2_dbf.free_result(rls2_db, result);
636
+		if(result) rls_dbf.free_result(rls_db, result);
637 637
 		return(-1);
638 638
 	}
639 639
 
... ...
@@ -645,14 +645,14 @@ int update_subs_rlsdb( subs_t *subs )
645 645
 	{
646 646
 		/* no match */ 
647 647
 		LM_ERR( "update_subs_rlsdb: NO MATCH\n" );
648
-		rls2_dbf.free_result(rls2_db, result);
648
+		rls_dbf.free_result(rls_db, result);
649 649
 		return(-1);
650 650
 	}
651 651
 
652 652
 	if (nr_rows != 1)
653 653
 	{
654 654
 		LM_ERR( "update_subs_rlsdb: TOO MANY MATCHES=%d\n", nr_rows);
655
-		rls2_dbf.free_result(rls2_db, result);
655
+		rls_dbf.free_result(rls_db, result);
656 656
 		return(-1);
657 657
 	}
658 658
 
... ...
@@ -675,7 +675,7 @@ int update_subs_rlsdb( subs_t *subs )
675 675
 	if ( r_remote_cseq >= subs->remote_cseq)
676 676
 	{
677 677
 		LM_DBG("stored cseq= %d\n", r_remote_cseq);
678
-		rls2_dbf.free_result(rls2_db, result);
678
+		rls_dbf.free_result(rls_db, result);
679 679
 		return(401); /*stale cseq code */
680 680
 	}
681 681
 
... ...
@@ -689,7 +689,7 @@ int update_subs_rlsdb( subs_t *subs )
689 689
 	if(subs->pres_uri.s== NULL)
690 690
 	{
691 691
 		LM_ERR( "Out of Memory\n" );
692
-		rls2_dbf.free_result(rls2_db, result);
692
+		rls_dbf.free_result(rls_db, result);
693 693
 		return(-1);
694 694
 	}
695 695
 
... ...
@@ -704,7 +704,7 @@ int update_subs_rlsdb( subs_t *subs )
704 704
 		{
705 705
 			LM_ERR( "Out of Memory\n" );
706 706
  			pkg_free(subs->pres_uri.s);
707
-			rls2_dbf.free_result(rls2_db, result);
707
+			rls_dbf.free_result(rls_db, result);
708 708
 			return(-1);
709 709
 		}
710 710
 		memcpy(subs->record_route.s, 
... ...
@@ -715,7 +715,7 @@ int update_subs_rlsdb( subs_t *subs )
715 715
 	subs->local_cseq= r_local_cseq;
716 716
 	subs->version= r_version;
717 717
 
718
-	rls2_dbf.free_result(rls2_db, result);
718
+	rls_dbf.free_result(rls_db, result);
719 719
 
720 720
 
721 721
 	/*if(s->db_flag & NO_UPDATEDB_FLAG)
... ...
@@ -727,7 +727,7 @@ int update_subs_rlsdb( subs_t *subs )
727 727
 	data_vals[db_flag_col].val.int_val= s->db_flag;
728 728
 	n_data_cols++;*/
729 729
 
730
-	if(rls2_dbf.update(rls2_db, query_cols, 0, query_vals,
730
+	if(rls_dbf.update(rls_db, query_cols, 0, query_vals,
731 731
                     data_cols,data_vals,n_query_cols,n_data_cols) < 0)
732 732
 	{
733 733
 		LM_ERR("Failed update db\n");
... ...
@@ -759,13 +759,13 @@ int insert_rlsdb( subs_t *s )
759 759
 
760 760
 	if (s==NULL) return(-1);
761 761
 
762
-	if(rls2_db == NULL)
762
+	if(rls_db == NULL)
763 763
 	{
764 764
 		LM_ERR("null database connection\n");
765 765
 		return(-1);
766 766
 	}
767 767
 
768
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
768
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
769 769
 	{
770 770
 		LM_ERR("use table failed\n");
771 771
 		return(-1);
... ...
@@ -903,7 +903,7 @@ int insert_rlsdb( subs_t *s )
903 903
 	data_vals[db_flag_col].val.int_val= s->db_flag;
904 904
 	n_data_cols++;*/
905 905
 
906
-	if(rls2_dbf.insert(rls2_db, data_cols, data_vals, n_data_cols) < 0)
906
+	if(rls_dbf.insert(rls_db, data_cols, data_vals, n_data_cols) < 0)
907 907
 	{
908 908
 		LM_ERR("db insert failed\n");
909 909
 		return(-1);
... ...
@@ -932,13 +932,13 @@ int matches_in_rlsdb( str callid, str to_tag, str from_tag )
932 932
 		to_tag.len, to_tag.s,
933 933
 		from_tag.len, from_tag.s );
934 934
 
935
-	if(rls2_db == NULL)
935
+	if(rls_db == NULL)
936 936
 	{
937 937
 		LM_ERR("null database connection\n");
938 938
 		return(-1);
939 939
 	}
940 940
 
941
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
941
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
942 942
 	{
943 943
 		LM_ERR("use table failed\n");
944 944
 		return(-1);
... ...
@@ -964,18 +964,18 @@ int matches_in_rlsdb( str callid, str to_tag, str from_tag )
964 964
 	
965 965
 	result_cols[0]= &str_callid_col; /* should use id column instead here */
966 966
 	
967
-	if(rls2_dbf.query(rls2_db, query_cols, 0, query_vals, result_cols, 
967
+	if(rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols, 
968 968
 			n_query_cols, 1, 0, &result )< 0)
969 969
 	{
970 970
 		LM_ERR("Can't query db\n");
971
-		if(result) rls2_dbf.free_result(rls2_db, result);
971
+		if(result) rls_dbf.free_result(rls_db, result);
972 972
 		return(-1);
973 973
 	}
974 974
 
975 975
 	if(result == NULL) return(-1);
976 976
 
977 977
 	rval = result->n;
978
-	rls2_dbf.free_result(rls2_db, result);
978
+	rls_dbf.free_result(rls_db, result);
979 979
 	if (rlsdb_debug) LM_ERR( "Done matches=%d\n", rval );
980 980
 	return(rval);
981 981
 }
... ...
@@ -1012,13 +1012,13 @@ subs_t *get_dialog_rlsdb( str callid, str to_tag, str from_tag )
1012 1012
 		to_tag.len, to_tag.s,
1013 1013
 		from_tag.len, from_tag.s );
1014 1014
 
1015
-	if(rls2_db == NULL)
1015
+	if(rls_db == NULL)
1016 1016
 	{
1017 1017
 		LM_ERR("null database connection\n");
1018 1018
 		return(NULL);
1019 1019
 	}
1020 1020
 
1021
-	if(rls2_dbf.use_table(rls2_db, &rlsubs_table)< 0)
1021
+	if(rls_dbf.use_table(rls_db, &rlsubs_table)< 0)
1022 1022
 	{
1023 1023
 		LM_ERR("use table failed\n");
1024 1024
 		return(NULL);
... ...
@@ -1065,11 +1065,11 @@ subs_t *get_dialog_rlsdb( str callid, str to_tag, str from_tag )
1065 1065
 	result_cols[r_expires_col=n_result_cols++] = &str_expires_col;
1066 1066
 
1067 1067
 
1068
-	if(rls2_dbf.query(rls2_db, query_cols, 0, query_vals, result_cols, 
1068
+	if(rls_dbf.query(rls_db, query_cols, 0, query_vals, result_cols, 
1069 1069
 				n_query_cols, n_result_cols, 0, &result )< 0)
1070 1070
 	{
1071 1071
 		LM_ERR("Can't query db\n");
1072
-		if(result) rls2_dbf.free_result(rls2_db, result);
1072
+		if(result) rls_dbf.free_result(rls_db, result);
1073 1073
 		return(NULL);
1074 1074
 	}
1075 1075
 
... ...
@@ -1081,14 +1081,14 @@ subs_t *get_dialog_rlsdb( str callid, str to_tag, str from_tag )
1081 1081
 	{
1082 1082
 		/* no match */ 
1083 1083
 		LM_INFO( "get_dialog_rlsdb No matching records\n" );
1084
-		rls2_dbf.free_result(rls2_db, result);
1084
+		rls_dbf.free_result(rls_db, result);
1085 1085
 		return(NULL);
1086 1086
 	}
1087 1087
 
1088 1088
 	if (nr_rows != 1)
1089 1089
 	{
1090 1090
 		LM_ERR( "get_dialog_rlsdb multiple matching records\n" );
1091
-		rls2_dbf.free_result(rls2_db, result);
1091
+		rls_dbf.free_result(rls_db, result);
1092 1092
 		return(NULL);
1093 1093
 	}
1094 1094
 
... ...
@@ -1120,7 +1120,7 @@ subs_t *get_dialog_rlsdb( str callid, str to_tag, str from_tag )
1120 1120
 		{
1121 1121
 			LM_ERR( "Can't allocate memory\n" );
1122 1122
 			/* tidy up and return >>>>>>>>>>>>>>>>>>>> */
1123
-			rls2_dbf.free_result(rls2_db, result);
1123
+			rls_dbf.free_result(rls_db, result);
1124 1124
 			return(NULL);
1125 1125
 		}
1126 1126
 		memset(dest, 0, size);
... ...
@@ -1166,7 +1166,7 @@ subs_t *get_dialog_rlsdb( str callid, str to_tag, str from_tag )
1166 1166
 		/*dest->db_flag= VAL_INT(values+r_db_flag_col);*/
1167 1167
 	}
1168 1168
 
1169
-	rls2_dbf.free_result(rls2_db, result);
1169
+	rls_dbf.free_result(rls_db, result);
1170 1170
 
1171 1171
 	if (rlsdb_debug) LM_ERR( "Done\n" );
1172 1172
 	return(dest);