[svn-commits] oej: branch 1.4 r47509 - /branches/1.4/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Nov 12 08:27:00 MST 2006


Author: oej
Date: Sun Nov 12 09:27:00 2006
New Revision: 47509

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47509
Log:
- Don't destroy SIP dialog because of a failed T.38 re-invite. Wait for a bye. 
  Final response to a re-invite does not mean that the session dies, only that
  the re-invite fails.
- Keep RTP active during processing of T.38 re-invite. If the re-invite fails,
  RTP needs to remain as before the re-invite.

Issue 8338 - darren1713. Please test.

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=47509&r1=47508&r2=47509
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Sun Nov 12 09:27:00 2006
@@ -4764,22 +4764,6 @@
 	memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
 	if (vhp)
 		memcpy(&vsin.sin_addr, vhp->h_addr, sizeof(vsin.sin_addr));
-		
-	if (p->rtp) {
-		if (portno > 0) {
-			sin.sin_port = htons(portno);
-			ast_rtp_set_peer(p->rtp, &sin);
-			if (debug)
-				ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
-		} else {
-			ast_rtp_stop(p->rtp);
-			if (debug)
-				ast_verbose("Peer doesn't provide audio\n");
-		}
-	}
-	/* Setup video port number */
-	if (vportno != -1)
-		vsin.sin_port = htons(vportno);
 
 	/* Setup UDPTL port number */
 	if (p->udptl) {
@@ -4794,6 +4778,28 @@
 				ast_log(LOG_DEBUG, "Peer doesn't provide T.38 UDPTL\n");
 		}
 	}
+
+		
+	if (p->rtp) {
+		if (portno > 0) {
+			sin.sin_port = htons(portno);
+			ast_rtp_set_peer(p->rtp, &sin);
+			if (debug)
+				ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+		} else {
+			if (udptlportno > 0) {
+				if (debug)
+					ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session. Callid %s\n", p->callid);
+			} else {
+				ast_rtp_stop(p->rtp);
+				if (debug)
+					ast_verbose("Peer doesn't provide audio. Callid %s\n", p->callid);
+			}
+		}
+	}
+	/* Setup video port number */
+	if (vportno != -1)
+		vsin.sin_port = htons(vportno);
 
 	/* Next, scan through each "a=rtpmap:" line, noting each
 	 * specified RTP payload type (with corresponding MIME subtype):
@@ -13245,7 +13251,7 @@
 									transmit_response(p, "488 Not acceptable here", req);
 								else
 									transmit_response_reliable(p, "488 Not acceptable here", req);
-								sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+							
 							}
 						} else {
 							/* The other side is already setup for T.38 most likely so we need to acknowledge this too */
@@ -13263,7 +13269,9 @@
 						p->t38.state = T38_DISABLED;
 						if (option_debug > 1)
 							ast_log(LOG_DEBUG,"T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
-						sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+
+						if (!p->lastinvite) /* Only destroy if this is *not* a re-invite */
+							sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 					}
 				} else {
 					/* we are not bridged in a call */
@@ -13290,7 +13298,6 @@
 								transmit_response(p, "488 Not Acceptable Here (unsupported)", req);
 							else
 								transmit_response_reliable(p, "488 Not Acceptable Here (unsupported)", req);
-							sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 							sendok = FALSE;
 						} 
 						/* No bridged peer with T38 enabled*/



More information about the svn-commits mailing list