Hi Konstantin,

I have attached the patch that allows calling onsend route also for replies. After the 3.3 release is done, I will commit it also upstream.

Regards,
Anca


On 05/14/2012 09:00 PM, Konstantin M. wrote:
Hi Marius,

My opinion that a replies should be routed to onsend_route after onreply_route in order unless they are dropped in onreply_route. It's by a common sense I think. All the traffic that is being sent/replied/forwarded and so on (in a short, all outgoing traffic) should trigger some callback.
A good point to use onsend_route for replies/forwardings/etc too I think.

There is a good reason (at least to me) which I need to see/parse them: my outgoing provider has a highly unwanted feature to us: forked calls. I have some program which is analyzing a remote leg connection state (no answer/busy/reorder, etc...) and this app is also analyzing all RTP which are sending within SDP on 180/181/183 messages. Let's say that Telco can send a multiple 183 SDP with a different IP/audio ports (c=/m=) and our application (which hasn't support for forking calls) is receive a multiple rtp streams to the same rtp port. Sure thing I did a proper logic to drop >1 of 180/181/183 sdp with a different contact info but I need to capture all the outgoing traffic
that is routing to outbound from kamailio.
I have to use wireshark just to see which replies are being set instead of just log them into a syslog/file.

Could you please share with me that patch ?

Thanks,





2012/5/14 Marius Zbihlei <marius.zbih...@1and1.ro <mailto:marius.zbih...@1and1.ro>>

    Hello,

    Normally, onsend_route is not triggered for replies, only for
    messages. If there are some good reasons behind it, I don't know,
    as we have a simple patch that enables this (we are reviewing it
    before pushing it to upstream). Of course, no changes to the
    messages/replies are permitted ...

    So again, is there a cause why onsend_route is not triggered for
    replies atm?

-- Zbihlei Marius

    Head of
    Linux Development Services Romania

    1&1 Internet Development srl    Tel KA: 754-9152
    Str Mircea Eliade 18            Tel RO:+40-31-223-9152  
<tel:%2B40-31-223-9152>
    Sect 1, Bucuresti               mailto:marius.zbih...@1and1.ro  
<mailto:marius.zbih...@1and1.ro>
    71295, Romania


    _______________________________________________
    SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
    list
    sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
    http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--- /home/avamanu/work/sip-router/forward.c	2012-05-09 17:16:38.437463174 +0300
+++ forward.c	2012-05-15 14:31:32.282233512 +0300
@@ -839,6 +839,18 @@
 		STATS_RPL_FWD_DROP();
 		goto error;
 	}
+
+	/* call onsend_route */
+	if(dst.send_sock == NULL) {
+		dst.send_sock=get_send_socket(msg, &dst.to, dst.proto);
+		if (dst.send_sock==0){
+			LOG(L_ERR, "forward_reply: ERROR: cannot forward reply\n");
+			goto done;
+		}
+	}
+	run_onsend(msg, &dst, new_buf, new_len);
+
+done:
 #ifdef STATS
 	STATS_TX_RESPONSE(  (msg->first_line.u.reply.statuscode/100) );
 #endif
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to