[sr-dev] git:treimann/master_tm-extend-callbacks: tm: Provide sent buffer ( processed message) in callback to

Timo Reimann timo.reimann at 1und1.de
Mon Oct 17 20:12:08 CEST 2011


Module: sip-router
Branch: treimann/master_tm-extend-callbacks
Commit: 9f0e2ebebc9acb10bb92e695c30c74286296c80d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9f0e2ebebc9acb10bb92e695c30c74286296c80d

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Wed Oct  5 11:15:04 2011 +0200

tm: Provide sent buffer (processed message) in callback to
TMCB_RESPONSE_OUT.

---

 modules/tm/t_reply.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 50ef8c9..1a11038 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -649,8 +649,11 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
 		if (likely(SEND_PR_BUFFER( rb, buf, len )>=0)){
 			if (unlikely(code>=200 && !is_local(trans) &&
 						has_tran_tmcbs(trans, TMCB_RESPONSE_OUT)) )
-				run_trans_callbacks(TMCB_RESPONSE_OUT, trans,
-									trans->uas.request, FAKED_REPLY, code);
+				INIT_TMCB_ONSEND_PARAMS(onsend_params, trans->uas.request,
+								FAKED_REPLY, rb, &rb->dst,
+								buf, len, TMCB_LOCAL_F, rb->branch, code);
+				run_trans_callbacks_off_params(TMCB_RESPONSE_OUT, trans,
+				                               &onsend_params);
 			if (unlikely(has_tran_tmcbs(trans, TMCB_RESPONSE_SENT))){
 				INIT_TMCB_ONSEND_PARAMS(onsend_params, trans->uas.request,
 								FAKED_REPLY, rb, &rb->dst, 
@@ -1820,8 +1823,8 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 		if (likely(uas_rb->dst.send_sock &&
 					SEND_PR_BUFFER( uas_rb, buf, res_len ) >= 0)){
 			if (unlikely(!totag_retr && has_tran_tmcbs(t, TMCB_RESPONSE_OUT))){
-				run_trans_callbacks( TMCB_RESPONSE_OUT, t, t->uas.request,
-					relayed_msg, relayed_code);
+				run_trans_callbacks_with_buf( TMCB_RESPONSE_OUT, uas_rb, t->uas.request,
+				                              relayed_msg, relayed_code);
 			}
 			if (unlikely(has_tran_tmcbs(t, TMCB_RESPONSE_SENT))){
 				INIT_TMCB_ONSEND_PARAMS(onsend_params, t->uas.request,




More information about the sr-dev mailing list