Pārlūkot izejas kodu

modules/ims_charging: removed unused code linking to ims_usrloc_scscf

jaybeepee 9 gadi atpakaļ
vecāks
revīzija
8effb18ca9

+ 0 - 89
modules/ims_charging/dialog.c

@@ -1,14 +1,11 @@
 #include "mod.h"
 #include "dialog.h"
 #include "ro_session_hash.h"
-#include "../ims_usrloc_scscf/usrloc.h"
-#include "../ims_usrloc_scscf/udomain.h"
 #include "ro_db_handler.h"
 #include "ims_charging_stats.h"
 
 struct cdp_binds cdpb;
 
-extern usrloc_api_t ul;
 extern int ro_db_mode;
 extern char *domain;
 extern struct dlg_binds dlgb;
@@ -221,89 +218,3 @@ void dlg_terminated(struct dlg_cell *dlg, int type, unsigned int termcode, char*
 		//}
 	}
 }
-
-void remove_dlg_data_from_contact(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) {
-        
-    struct impu_data *impu_data;
-    impurecord_t* implicit_impurecord = 0;
-    struct ucontact* ucontact;
-    str callid = {0, 0};
-    str path = {0, 0};
-    udomain_t* domain_t;
-    
-    LM_DBG("dialog [%p] terminated, lets remove dlg data from contact\n", dlg);
-    
-    if (ul.register_udomain(domain, &domain_t) < 0) {
-	    LM_ERR("Unable to register usrloc domain....aborting\n");
-	    return;
-    }
-    
-    if(_params && _params->param){
-	impu_data = (struct impu_data*)*_params->param;
-	if (!impu_data) {
-		LM_ERR("IMPU data object is NULL...... aborting\n");
-		return;
-	}
-	
-	LM_DBG("IMPU data is present, contact: <%.*s> identity <%.*s>", impu_data->contact.len, impu_data->contact.s, impu_data->identity.len, impu_data->identity.s);
-	LM_DBG("IMPU data domain <%.*s>", domain_t->name->len, domain_t->name->s);
-	
-	ul.lock_udomain(domain_t, &impu_data->identity);
-	if (ul.get_impurecord(domain_t, &impu_data->identity, &implicit_impurecord) != 0) {
-	    LM_DBG("usrloc does not have imprecord for implicity IMPU, ignore\n");
-	}else {
-	    if (ul.get_ucontact(&impu_data->contact, &callid, &path, 0/*cseq*/,  &ucontact) != 0) { //contact does not exist
-		LM_DBG("This contact: <%.*s> is not in usrloc, ignore - NOTE: You need S-CSCF usrloc set to match_mode CONTACT_PORT_IP_ONLY\n", impu_data->contact.len, impu_data->contact.s);
-	    } else {//contact exists so add dialog data to it
-		ul.remove_dialog_data_from_contact(ucontact, dlg->h_entry, dlg->h_id);
-		ul.release_ucontact(ucontact);
-	    }
-	}
-	ul.unlock_udomain(domain_t, &impu_data->identity);
-	free_impu_data(impu_data);
-    }
-    
-    //we referenced the dialog when we registered for callbacks on it...
-    dlgb.release_dlg(dlg);
-}
-
-void add_dlg_data_to_contact(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) {
-    
-    struct impu_data *impu_data;
-    impurecord_t* implicit_impurecord = 0;
-    struct ucontact* ucontact;
-    str callid = {0, 0};
-    str path = {0, 0};
-    udomain_t* domain_t;
-    
-    LM_DBG("dialog [%p] confirmed, lets add dlg data to contact\n", dlg);
-    
-    if (ul.register_udomain(domain, &domain_t) < 0) {
-	    LM_ERR("Unable to register usrloc domain....aborting\n");
-	    return;
-    }
-    
-    if(_params && _params->param){
-	impu_data = (struct impu_data*)*_params->param;
-	if (!impu_data) {
-		LM_ERR("IMPU data object is NULL...... aborting\n");
-		return;
-	}
-	
-	LM_DBG("IMPU data is present, contact: <%.*s> identity <%.*s>", impu_data->contact.len, impu_data->contact.s, impu_data->identity.len, impu_data->identity.s);
-	LM_DBG("IMPU data domain <%.*s>", domain_t->name->len, domain_t->name->s);
-	
-	ul.lock_udomain(domain_t, &impu_data->identity);
-	if (ul.get_impurecord(domain_t, &impu_data->identity, &implicit_impurecord) != 0) {
-	    LM_DBG("usrloc does not have imprecord for implicity IMPU, ignore\n");
-	}else {
-	    if (ul.get_ucontact(&impu_data->contact, &callid, &path, 0/*cseq*/,  &ucontact) != 0) { //contact does not exist
-		LM_DBG("This contact: <%.*s> is not in usrloc, ignore - NOTE: You need S-CSCF usrloc set to match_mode CONTACT_PORT_IP_ONLY\n", impu_data->contact.len, impu_data->contact.s);
-	    } else {//contact exists so add dialog data to it
-		ul.add_dialog_data_to_contact(ucontact, dlg->h_entry, dlg->h_id);
-		ul.release_ucontact(ucontact);
-	    }
-	}
-	ul.unlock_udomain(domain_t, &impu_data->identity);
-    }
-} 

+ 0 - 2
modules/ims_charging/dialog.h

@@ -11,7 +11,5 @@ extern int ro_timer_buffer;
 void dlg_callback_received(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params);
 void dlg_terminated(struct dlg_cell *dlg, int type, unsigned int termcode, char* reason, struct dlg_cb_params *_params);
 void dlg_answered(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params);
-void add_dlg_data_to_contact(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params);
-void remove_dlg_data_from_contact(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params);
 
 #endif

+ 0 - 23
modules/ims_charging/mod.c

@@ -17,7 +17,6 @@
 #include "ims_ro.h"
 #include "config.h"
 #include "dialog.h"
-#include "../ims_usrloc_scscf/usrloc.h"
 #include "../../lib/ims/ims_getters.h"
 #include "ro_db_handler.h"
 #include "ims_charging_stats.h"
@@ -68,8 +67,6 @@ struct dlg_binds dlgb;
 cdp_avp_bind_t *cdp_avp;
 struct tm_binds tmb;
 
-usrloc_api_t ul; /*!< Structure containing pointers to usrloc functions*/
-
 char* rx_dest_realm_s = "ims.smilecoms.com";
 str rx_dest_realm;
 /* Only used if we want to force the Ro peer usually this is configured at a stack level and the first request uses realm routing */
@@ -184,7 +181,6 @@ int fix_parameters() {
 static int mod_init(void) {
 	int n;
 	load_tm_f load_tm;
-	bind_usrloc_t bind_usrloc;
 
 	if (!fix_parameters()) {
 		LM_ERR("unable to set Ro configuration parameters correctly\n");
@@ -215,16 +211,6 @@ static int mod_init(void) {
 		goto error;
 	}
         
-        bind_usrloc = (bind_usrloc_t) find_export("ul_bind_usrloc", 1, 0);
-	if (!bind_usrloc) {
-	    LM_ERR("can't bind usrloc\n");
-	    return -1;
-	}
-	
-	if (bind_usrloc(&ul) < 0) {
-	    return -1;
-	}
-
 	/* init timer lists*/
 	if (init_ro_timer(ro_session_ontimeout) != 0) {
 		LM_ERR("cannot init timer list\n");
@@ -251,15 +237,6 @@ static int mod_init(void) {
 		LM_ERR("failed to register timer \n");
 		return -1;
 	}
-
-	
-
-	/*Register for callback of URECORD being deleted - so we can send a SAR*/
-
-	if (ul.register_ulcb == NULL) {
-	    LM_ERR("Could not import ul_register_ulcb\n");
-	    return -1;
-	}
 	
 	if (ims_charging_init_counters() != 0) {
 	    LM_ERR("Failed to register counters for ims_charging module\n");

+ 0 - 1
modules/ims_charging/ro_session_hash.h

@@ -10,7 +10,6 @@
 
 #include "ro_timer.h"
 #include "../../mem/shm_mem.h"
-#include "../ims_usrloc_scscf/usrloc.h"
 #include "ims_charging_stats.h"
 #include <stdlib.h>