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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 22 21:06:23 CDT 2007


Author: rizzo
Date: Sun Jul 22 21:06:22 2007
New Revision: 76457

URL: http://svn.digium.com/view/asterisk?view=rev&rev=76457
Log:
more small merges from trunk

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=76457&r1=76456&r2=76457
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Sun Jul 22 21:06:22 2007
@@ -1134,12 +1134,9 @@
 	return NULL;
 }
 
-#define FLAG_RESPONSE (1 << 0)	/* basically, any non-zero value */
-#define FLAG_FATAL (1 << 1)
-
 /*! \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.
+ * Packets are linked in a list, whose head is in the struct sip_pvt they belong to.
+ * Each packet holds a reference to the parent struct sip_pvt.
  * This structure is allocated in __sip_reliable_xmit() and only for packets that
  * require retransmissions.
  */
@@ -1148,8 +1145,8 @@
 	int retrans;				/*!< Retransmission number */
 	int method;				/*!< SIP method for this packet */
 	int seqno;				/*!< Sequence number */
-	char is_resp;				/*!< non-zero if this is a response packet (e.g. 200 OK) */
-	char is_fatal;				/*!< non-zero if this is a fatal error */
+	char is_resp;				/*!< 1 if this is a response packet (e.g. 200 OK), 0 if it is a request */
+	char is_fatal;				/*!< non-zero if there is a fatal error */
 	struct sip_pvt *pvt;			/*!< Owner AST call */
 	int retransid;				/*!< Retransmission ID */
 	int timer_a;				/*!< SIP timer A, retransmission timer */
@@ -2485,7 +2482,7 @@
 		pvt_unref(p);
 	} else {
 		append_history(p, "AutoDestroy", "%s", p->callid);
-		ast_debug(1, "Auto destroying SIP dialog '%s'\n", p->callid);
+		ast_debug(3, "Auto destroying SIP dialog '%s'\n", p->callid);
 		sip_destroy(p);	/* Go ahead and destroy dialog. All attempts to recover is done */
 		/* also absorbs the reference we have */
 	}
@@ -4446,6 +4443,7 @@
 		return NULL;
 	}
 	sip_pvt_lock(i);
+
 	tmp->tech = ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INFO ?  &sip_tech_info : &sip_tech;
 
 	/* Select our native format based on codec preference until we receive
@@ -16181,7 +16179,7 @@
 		if (seqno == p->pendinginvite) {
 			p->invitestate = INV_TERMINATED;
 			p->pendinginvite = 0;
-			__sip_ack(p, seqno, FLAG_RESPONSE, 0);
+			__sip_ack(p, seqno, 1 /* response */, 0);
 			if (find_sdp(req)) {
 				if (process_sdp(p, req))
 					return -1;
@@ -18029,7 +18027,7 @@
 	}
 	/*
 	 * handle changes in the socket used for communications.
-	 * At the beginning, sipsock = -1 and old_bindaddr = 0:0 so
+	 * At the beginning, sipsock = -1 and old_bindaddr = 0.0.0.0:0 so
 	 * we detect a change easily.
 	 */
 	if (sipsock == -1 || memcmp(&old_bindaddr, &bindaddr, sizeof(struct sockaddr_in))) {
@@ -18071,7 +18069,7 @@
 						ast_inet_ntoa(stunaddr.sin_addr) , ntohs(stunaddr.sin_port));
 					ast_stun_request(sipsock, &stunaddr,
 						NULL, &externip);
-					ast_debug(1, "stun sees us at %s:%d\n",
+					ast_debug(1, "STUN sees us at %s:%d\n",
 						ast_inet_ntoa(externip.sin_addr) , ntohs(externip.sin_port));
 				}
 				sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
@@ -18631,9 +18629,11 @@
 	ASTOBJ_CONTAINER_PRUNE_MARKED(&peerl, sip_destroy_peer);
 	ast_debug(4, "--------------- Done destroying pruned peers\n");
 
-	sip_poke_all_peers();		/* Send qualify (OPTIONS) to all peers */
-
-	sip_send_all_registers();	/* Register with all services */
+	/* Send qualify (OPTIONS) to all peers */
+	sip_poke_all_peers();
+
+	/* Register with all services */
+	sip_send_all_registers();
 
 	ast_debug(4, "--------------- SIP reload done\n");
 




More information about the asterisk-commits mailing list