[asterisk-commits] branch oej/t38passthrough r12540 - in /team/oej/t38passthrough: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Mar 12 09:23:50 MST 2006


Author: oej
Date: Sun Mar 12 10:23:46 2006
New Revision: 12540

URL: http://svn.digium.com/view/asterisk?rev=12540&view=rev
Log:
Patches from Paul Cadach

Modified:
    team/oej/t38passthrough/channel.c
    team/oej/t38passthrough/channels/chan_sip.c
    team/oej/t38passthrough/frame.c

Modified: team/oej/t38passthrough/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/channel.c?rev=12540&r1=12539&r2=12540&view=diff
==============================================================================
--- team/oej/t38passthrough/channel.c (original)
+++ team/oej/t38passthrough/channel.c Sun Mar 12 10:23:46 2006
@@ -2298,6 +2298,14 @@
 		else
 			res = 0;
 		break;
+#ifdef T38_SUPPORT
+	case AST_FRAME_MODEM:
+		if (chan->tech->write)
+			res = chan->tech->write(chan, fr);
+		else
+			res = 0;
+		break;
+#endif
 	case AST_FRAME_VOICE:
 		if (chan->tech->write) {
 			/* Bypass translator if we're writing format in the raw write format.  This

Modified: team/oej/t38passthrough/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/channels/chan_sip.c?rev=12540&r1=12539&r2=12540&view=diff
==============================================================================
--- team/oej/t38passthrough/channels/chan_sip.c (original)
+++ team/oej/t38passthrough/channels/chan_sip.c Sun Mar 12 10:23:46 2006
@@ -3940,11 +3940,18 @@
 	memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
 
 	/* Setup audio port number */
-	sin.sin_port = htons(portno);
-	if (p->rtp && sin.sin_port) {
-		ast_rtp_set_peer(p->rtp, &sin);
-		if (debug) {
-			ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+	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(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			}
+		} else {
+			ast_rtp_stop(p->rtp);
+			if (debug) {
+				ast_verbose("Peer doesn't provide audio\n");
+			}
 		}
 	}
 	/* Check for Media-description-level-address for video */
@@ -3963,20 +3970,33 @@
 		}
 	}
 	/* Setup video port number */
-	sin.sin_port = htons(vportno);
-	if (p->vrtp && sin.sin_port) {
-		ast_rtp_set_peer(p->vrtp, &sin);
-		if (debug) {
-			ast_verbose("Peer video RTP is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+	if (p->vrtp) {
+		if (vportno > 0) {
+			sin.sin_port = htons(vportno);
+			ast_rtp_set_peer(p->vrtp, &sin);
+			if (debug) {
+				ast_verbose("Peer video RTP is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			}
+		} else {
+			ast_rtp_stop(p->vrtp);
+			if (debug) {
+				ast_verbose("Peer doesn't provide video\n");
+			}
 		}
 	}
 #if defined(T38_SUPPORT)
 	/* Setup UDPTL port number */
-	sin.sin_port = htons(udptlportno);
-	if (p->udptl && (ast_test_flag(&p->t38.t38support, SIP_PAGE2_T38SUPPORT_UDPTL)) && sin.sin_port) {
-		ast_udptl_set_peer(p->udptl, &sin);
-		if (debug) {
-			ast_log(LOG_DEBUG,"Peer T.38 UDPTL is at port %s:%d\n",ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+	if (p->udptl && (ast_test_flag(&p->t38.t38support, SIP_PAGE2_T38SUPPORT_UDPTL))) {
+		if (udptlportno > 0) {
+			sin.sin_port = htons(udptlportno);
+			ast_udptl_set_peer(p->udptl, &sin);
+			if (debug) {
+				ast_log(LOG_DEBUG,"Peer T.38 UDPTL is at port %s:%d\n",ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			}
+		} else {
+			ast_udptl_stop(p->udptl);
+			if (debug) 
+				ast_log(LOG_DEBUG, "Peer doesn't provide T.38 UDPTL\n");
 		}
 	}
 #endif

Modified: team/oej/t38passthrough/frame.c
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/frame.c?rev=12540&r1=12539&r2=12540&view=diff
==============================================================================
--- team/oej/t38passthrough/frame.c (original)
+++ team/oej/t38passthrough/frame.c Sun Mar 12 10:23:46 2006
@@ -786,6 +786,22 @@
 			break;
 		}
 		break;
+#ifdef T38_SUPPORT
+	case AST_FRAME_MODEM:
+		strcpy(ftype, "Modem");
+		switch (f->subclass) {
+		case AST_MODEM_T38:
+			strcpy(subclass, "T.38");
+			break;
+		case AST_MODEM_V150:
+			strcpy(subclass, "V.150");
+			break;
+		default:
+			snprintf(subclass, sizeof(subclass), "Unknown MODEM frame '%d'\n", f->subclass);
+			break;
+		}
+		break;
+#endif
 	default:
 		snprintf(ftype, sizeof(ftype), "Unknown Frametype '%d'", f->frametype);
 	}



More information about the asterisk-commits mailing list