|
@@ -64,6 +64,7 @@
|
|
#include "../../parser/hf.h"
|
|
#include "../../parser/hf.h"
|
|
#include "../../lib/ims/ims_getters.h"
|
|
#include "../../lib/ims/ims_getters.h"
|
|
#include "registrar_notify.h"
|
|
#include "registrar_notify.h"
|
|
|
|
+#include "pvt_message.h"
|
|
|
|
|
|
extern struct cdp_binds cdpb;
|
|
extern struct cdp_binds cdpb;
|
|
|
|
|
|
@@ -103,6 +104,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *saa, long elaps
|
|
int rc = -1, experimental_rc = -1;
|
|
int rc = -1, experimental_rc = -1;
|
|
int result = CSCF_RETURN_TRUE;
|
|
int result = CSCF_RETURN_TRUE;
|
|
saved_transaction_t* data = 0;
|
|
saved_transaction_t* data = 0;
|
|
|
|
+ struct sip_msg* req;
|
|
|
|
|
|
str xml_data = {0, 0}, ccf1 = {0, 0}, ccf2 = {0, 0}, ecf1 = {0, 0}, ecf2 = {0, 0};
|
|
str xml_data = {0, 0}, ccf1 = {0, 0}, ccf2 = {0, 0}, ecf1 = {0, 0}, ecf2 = {0, 0};
|
|
ims_subscription* s = 0;
|
|
ims_subscription* s = 0;
|
|
@@ -156,6 +158,12 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *saa, long elaps
|
|
|
|
|
|
get_act_time();
|
|
get_act_time();
|
|
|
|
|
|
|
|
+ req = get_request_from_tx(t);
|
|
|
|
+ if (!req) {
|
|
|
|
+ LM_ERR("Failed to get SIP Request from Transaction\n");
|
|
|
|
+ goto error_no_send;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (is_timeout) {
|
|
if (is_timeout) {
|
|
update_stat(stat_sar_timeouts, 1);
|
|
update_stat(stat_sar_timeouts, 1);
|
|
LM_ERR("Transaction timeout - did not get SAA\n");
|
|
LM_ERR("Transaction timeout - did not get SAA\n");
|
|
@@ -171,8 +179,9 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *saa, long elaps
|
|
update_stat(sar_replies_received, 1);
|
|
update_stat(sar_replies_received, 1);
|
|
update_stat(sar_replies_response_time, elapsed_msecs);
|
|
update_stat(sar_replies_response_time, elapsed_msecs);
|
|
|
|
|
|
|
|
+
|
|
/* check and see that all the required headers are available and can be parsed */
|
|
/* check and see that all the required headers are available and can be parsed */
|
|
- if (parse_message_for_register(t->uas.request) < 0) {
|
|
|
|
|
|
+ if (parse_message_for_register(req) < 0) {
|
|
LM_ERR("Unable to parse register message correctly\n");
|
|
LM_ERR("Unable to parse register message correctly\n");
|
|
rerrno = R_SAR_FAILED;
|
|
rerrno = R_SAR_FAILED;
|
|
goto error;
|
|
goto error;
|
|
@@ -250,7 +259,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *saa, long elaps
|
|
|
|
|
|
if (s) {
|
|
if (s) {
|
|
//here we update the contacts and also build the new contact header for the 200 OK reply
|
|
//here we update the contacts and also build the new contact header for the 200 OK reply
|
|
- if (update_contacts_new(t->uas.request, data->domain, &data->public_identity, data->sar_assignment_type, &s, &ccf1, &ccf2, &ecf1, &ecf2, &data->contact_header) <= 0) {
|
|
|
|
|
|
+ if (update_contacts(req, data->domain, &data->public_identity, data->sar_assignment_type, &s, &ccf1, &ccf2, &ecf1, &ecf2, &data->contact_header) <= 0) {
|
|
LM_ERR("Error processing REGISTER\n");
|
|
LM_ERR("Error processing REGISTER\n");
|
|
rerrno = R_SAR_FAILED;
|
|
rerrno = R_SAR_FAILED;
|
|
goto error;
|
|
goto error;
|
|
@@ -270,7 +279,7 @@ success:
|
|
|
|
|
|
done:
|
|
done:
|
|
if (data->sar_assignment_type != AVP_IMS_SAR_UNREGISTERED_USER)
|
|
if (data->sar_assignment_type != AVP_IMS_SAR_UNREGISTERED_USER)
|
|
- reg_send_reply_transactional(t->uas.request, data->contact_header, t);
|
|
|
|
|
|
+ reg_send_reply_transactional(req, data->contact_header, t);
|
|
LM_DBG("DBG:SAR Async CDP callback: ... Done resuming transaction\n");
|
|
LM_DBG("DBG:SAR Async CDP callback: ... Done resuming transaction\n");
|
|
|
|
|
|
create_return_code(result);
|
|
create_return_code(result);
|
|
@@ -282,11 +291,11 @@ done:
|
|
//free memory
|
|
//free memory
|
|
if (saa) cdpb.AAAFreeMessage(&saa);
|
|
if (saa) cdpb.AAAFreeMessage(&saa);
|
|
if (t) {
|
|
if (t) {
|
|
- del_nonshm_lump_rpl(&t->uas.request->reply_lump);
|
|
|
|
|
|
+// del_nonshm_lump_rpl(&req->reply_lump);
|
|
tmb.unref_cell(t);
|
|
tmb.unref_cell(t);
|
|
}
|
|
}
|
|
//free path vector pkg memory
|
|
//free path vector pkg memory
|
|
- reset_path_vector(t->uas.request);
|
|
|
|
|
|
+// reset_path_vector(req);
|
|
|
|
|
|
tmb.t_continue(data->tindex, data->tlabel, data->act);
|
|
tmb.t_continue(data->tindex, data->tlabel, data->act);
|
|
free_saved_transaction_data(data);
|
|
free_saved_transaction_data(data);
|
|
@@ -295,14 +304,14 @@ done:
|
|
error:
|
|
error:
|
|
create_return_code(-2);
|
|
create_return_code(-2);
|
|
if (data->sar_assignment_type != AVP_IMS_SAR_UNREGISTERED_USER)
|
|
if (data->sar_assignment_type != AVP_IMS_SAR_UNREGISTERED_USER)
|
|
- reg_send_reply_transactional(t->uas.request, data->contact_header, t);
|
|
|
|
|
|
+ reg_send_reply_transactional(req, data->contact_header, t);
|
|
|
|
|
|
error_no_send: //if we don't have the transaction then we can't send a transaction response
|
|
error_no_send: //if we don't have the transaction then we can't send a transaction response
|
|
update_stat(rejected_registrations, 1);
|
|
update_stat(rejected_registrations, 1);
|
|
//free memory
|
|
//free memory
|
|
if (saa) cdpb.AAAFreeMessage(&saa);
|
|
if (saa) cdpb.AAAFreeMessage(&saa);
|
|
if (t) {
|
|
if (t) {
|
|
- del_nonshm_lump_rpl(&t->uas.request->reply_lump);
|
|
|
|
|
|
+// del_nonshm_lump_rpl(&req->reply_lump);
|
|
tmb.unref_cell(t);
|
|
tmb.unref_cell(t);
|
|
}
|
|
}
|
|
tmb.t_continue(data->tindex, data->tlabel, data->act);
|
|
tmb.t_continue(data->tindex, data->tlabel, data->act);
|