|
@@ -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);
|
|
|
- }
|
|
|
-}
|