[asterisk-commits] rizzo: branch rizzo/astobj2 r47946 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 22 14:52:50 MST 2006


Author: rizzo
Date: Wed Nov 22 15:52:50 2006
New Revision: 47946

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47946
Log:
make  send_request and send_response more similar, hopefully
we can merge them.


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47946&r1=47945&r2=47946
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Wed Nov 22 15:52:50 2006
@@ -1075,7 +1075,9 @@
 
 /*! \brief sip packet - raw format for outbound packets that are sent or scheduled for transmission
  * Packets are linked in a list, whose head is in the sip_pvt they belong to.
- * Each packet holds a reference to the parent sip_pvt
+ * Each packet holds a reference to the parent sip_pvt.
+ * This structure is allocated in __sip_reliable_xmit() and only for packets that
+ * require retransmissions.
  */
 struct sip_pkt {
 	struct sip_pkt *next;			/*!< Next packet in linked list */
@@ -2390,6 +2392,8 @@
 
 /*! \brief Send SIP Request to the other part of the dialogue
  * Assumes that a reference to p exists in the caller.
+ * XXX this is basically the same as send_response apart from the history tag
+ * and the third argument to __sip_reliable_xmit()
  */
 static int send_request(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno)
 {
@@ -2397,10 +2401,12 @@
 
 	add_blank(req);
 	if (sip_debug_test_pvt(p)) {
-		if (ast_test_flag(&p->flags[0], SIP_NAT_ROUTE))
-			ast_verbose("%sTransmitting (NAT) to %s:%d:\n%s\n---\n", reliable ? "Reliably " : "", ast_inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port), req->data);
-		else
-			ast_verbose("%sTransmitting (no NAT) to %s:%d:\n%s\n---\n", reliable ? "Reliably " : "", ast_inet_ntoa(p->sa.sin_addr), ntohs(p->sa.sin_port), req->data);
+		const struct sockaddr_in *dst = sip_real_dst(p);
+
+		ast_verbose("%si<--- Transmitting (%s) to %s:%d:\n%s\n---\n",
+			reliable ? "Reliably " : "", sip_nat_mode(p),
+			ast_inet_ntoa(dst->sin_addr),
+			ntohs(dst->sin_port), req->data);
 	}
 	if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY)) {
 		struct sip_request tmp;



More information about the asterisk-commits mailing list