Sfoglia il codice sorgente

modules/tm: Filled in the $snd() structure for event_route[tm:local-request]
(cherry picked from commit 43e7274cad12535fc20d0e669d87939c1c18f399)

Peter Dunkley 13 anni fa
parent
commit
709c7498dd
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  1. 10 0
      modules/tm/uac.c

+ 10 - 0
modules/tm/uac.c

@@ -86,6 +86,7 @@
 #include "../../receive.h"
 #include "../../route.h"
 #include "../../action.h"
+#include "../../onsend.h"
 #include "t_lookup.h"
 #endif
 
@@ -349,6 +350,8 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
 				LM_ERR("failed to set dst_uri");
 				free_sip_msg(&lreq);
 			} else {
+				struct onsend_info onsnd_info;
+
 				lreq.force_send_socket = uac_r->dialog->send_sock;
 				lreq.rcv.proto = dst.send_sock->proto;
 				lreq.rcv.src_ip = dst.send_sock->address;
@@ -363,6 +366,12 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
 				sflag_bk = getsflags();
 				tm_xdata_swap(new_cell, &backup_xd, 0);
 
+				onsnd_info.to=&dst.to;
+				onsnd_info.send_sock=dst.send_sock;
+				onsnd_info.buf=buf;
+				onsnd_info.len=buf_len;
+				p_onsend=&onsnd_info;
+
 				/* run the route */
 				backup_route_type = get_route_type();
 				set_route_type(LOCAL_ROUTE);
@@ -378,6 +387,7 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
 				set_t(backup_t, backup_branch);
 				global_msg_id=backup_msgid;
 				set_route_type( backup_route_type );
+				p_onsend=0;
 
 				/* restore original environment */
 				tm_xdata_swap(new_cell, &backup_xd, 1);