[sr-dev] git:richard.good/diameter_rx_media: modules/ims_qos: Use new TM suspend for Rx calling

Richard Good richard.good at smilecoms.com
Tue Apr 30 11:46:45 CEST 2013


Module: sip-router
Branch: richard.good/diameter_rx_media
Commit: 331bc6077ef98e79b237a6069ed2dfe5a0a97710
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=331bc6077ef98e79b237a6069ed2dfe5a0a97710

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date:   Tue Apr 30 11:44:54 2013 +0200

modules/ims_qos: Use new TM suspend for Rx calling

	Updating Rx calling to use the TM functions (in tm_async_reply_support branch) to suspend and continue on SIP replies.

---

 modules/ims_qos/mod.c    |   12 ++++++++++--
 modules/ims_qos/rx_aar.c |    2 +-
 modules/ims_qos/rx_aar.h |    1 +
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 46a5e9e..52d661b 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -505,6 +505,14 @@ static int w_rx_aar(struct sip_msg *msg, char* str1, char* bar) {
     memcpy(saved_t_data->ftag.s, ftag.s, ftag.len);
     saved_t_data->ftag.len = ftag.len;
 
+    //store branch
+    int branch;
+    if (tmb.t_check( msg  , &branch )==-1){
+        LOG(L_ERR, "ERROR: t_suspend: failed find UAC branch\n");
+        return CSCF_RETURN_ERROR;
+    }
+    saved_t_data->branch = branch;
+    
     //Check that we dont already have an auth session for this specific dialog
     //if not we create a new one and attach it to the dialog (via session ID).
     enum dialog_direction dlg_direction = get_dialog_direction(direction);
@@ -553,7 +561,7 @@ static int w_rx_aar(struct sip_msg *msg, char* str1, char* bar) {
     }
 
     LM_DBG("Suspending SIP TM transaction\n");
-    if (tmb.t_suspend(msg, &saved_t_data->tindex, &saved_t_data->tlabel) < 0) {
+    if (tmb.t_suspend_reply(msg, &saved_t_data->tindex, &saved_t_data->tlabel) < 0) {
         LM_ERR("failed to suspend the TM processing\n");
         free_saved_transaction_global_data(saved_t_data);
         return CSCF_RETURN_ERROR;
@@ -564,7 +572,7 @@ static int w_rx_aar(struct sip_msg *msg, char* str1, char* bar) {
 
     if (!ret) {
         LM_ERR("Failed to send AAR\n");
-        tmb.t_cancel_suspend(saved_t_data->tindex, saved_t_data->tlabel);
+        tmb.t_cancel_suspend_reply(saved_t_data->tindex, saved_t_data->tlabel, saved_t_data->branch);
         goto error;
 
 
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index f80fc00..ad8db69 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -165,7 +165,7 @@ done:
     if (aaa)
         cdpb.AAAFreeMessage(&aaa);
 
-    tmb.t_continue(data->tindex, data->tlabel, data->act);
+    tmb.t_continue_reply(data->tindex, data->tlabel, data->act, data->branch);
     free_saved_transaction_global_data(data);
 }
 
diff --git a/modules/ims_qos/rx_aar.h b/modules/ims_qos/rx_aar.h
index b578db5..f986ce5 100644
--- a/modules/ims_qos/rx_aar.h
+++ b/modules/ims_qos/rx_aar.h
@@ -82,6 +82,7 @@ typedef struct saved_transaction {
         str callid;
         str ftag;
         str ttag;
+        int branch;
 } saved_transaction_t;
 
 typedef struct saved_transaction_local {




More information about the sr-dev mailing list